-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
1,003 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 0 additions & 69 deletions
69
app/src/main/java/ceui/lisa/activities/NfcDemoActivity.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package ceui.lisa.fragments; | ||
|
||
import android.os.Bundle; | ||
|
||
import ceui.lisa.R; | ||
import ceui.lisa.base.BaseFragment; | ||
import ceui.lisa.databinding.FragmentBhBinding; | ||
|
||
public class FragmentBh extends BaseFragment<FragmentBhBinding> { | ||
|
||
public static FragmentBh newInstance() { | ||
return new FragmentBh(); | ||
} | ||
|
||
@Override | ||
protected void initLayout() { | ||
mLayoutID = R.layout.fragment_bh; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
app/src/main/java/ceui/lisa/fragments/FragmentNewRight.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package ceui.lisa.fragments; | ||
|
||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
|
||
import androidx.recyclerview.widget.LinearLayoutManager; | ||
|
||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import ceui.lisa.R; | ||
import ceui.lisa.activities.Shaft; | ||
import ceui.lisa.adapters.EventAdapter; | ||
import ceui.lisa.adapters.UserHAdapter; | ||
import ceui.lisa.database.AppDatabase; | ||
import ceui.lisa.database.IllustRecmdEntity; | ||
import ceui.lisa.databinding.FragmentNewRightBinding; | ||
import ceui.lisa.models.IllustsBean; | ||
import ceui.lisa.models.UserPreviewsBean; | ||
import ceui.lisa.utils.DensityUtil; | ||
import ceui.lisa.view.LinearItemHorizontalDecoration; | ||
|
||
public class FragmentNewRight extends BaseFragment<FragmentNewRightBinding> { | ||
|
||
public static FragmentNewRight newInstance() { | ||
return new FragmentNewRight(); | ||
} | ||
|
||
@Override | ||
public void initView(View view) { | ||
ViewGroup.LayoutParams headParams = baseBind.head.getLayoutParams(); | ||
headParams.height = Shaft.statusHeight; | ||
baseBind.head.setLayoutParams(headParams); | ||
|
||
baseBind.toolbar.inflateMenu(R.menu.fragment_left); | ||
|
||
baseBind.recyclerView.addItemDecoration(new LinearItemHorizontalDecoration( | ||
DensityUtil.dp2px(16.0f))); | ||
LinearLayoutManager manager = new LinearLayoutManager(mContext, | ||
LinearLayoutManager.HORIZONTAL, false); | ||
baseBind.recyclerView.setLayoutManager(manager); | ||
baseBind.recyclerView.setHasFixedSize(true); | ||
AppDatabase.getAppDatabase(mContext).recmdDao().getAll(); | ||
|
||
|
||
List<IllustRecmdEntity> entities = AppDatabase.getAppDatabase(mContext).recmdDao().getAll(); | ||
List<UserPreviewsBean> tempUser = new ArrayList<>(); | ||
List<IllustsBean> tempIllust = new ArrayList<>(); | ||
for (int i = 0; i < entities.size(); i++) { | ||
IllustsBean illustsBean = Shaft.sGson.fromJson( | ||
entities.get(i).getIllustJson(), IllustsBean.class); | ||
UserPreviewsBean userPreviewsBean = new UserPreviewsBean(); | ||
userPreviewsBean.setUser(illustsBean.getUser()); | ||
tempUser.add(userPreviewsBean); | ||
tempIllust.add(illustsBean); | ||
} | ||
baseBind.recyclerView.setAdapter(new UserHAdapter(tempUser, mContext)); | ||
|
||
baseBind.recyList.setLayoutManager(new LinearLayoutManager(mContext)); | ||
baseBind.recyList.setHasFixedSize(true); | ||
baseBind.recyList.setAdapter(new EventAdapter(tempIllust, mContext)); | ||
} | ||
|
||
@Override | ||
public void initLayout() { | ||
mLayoutID = R.layout.fragment_new_right; | ||
} | ||
} |
Oops, something went wrong.