mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
テスト用にアイテム追加
This commit is contained in:
parent
32cd27997c
commit
db26e639e6
|
@ -2,12 +2,19 @@ package one.nem.lacerta.setting;
|
|||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import one.nem.lacerta.setting.model.SettingListItem;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
* Use the {@link SettingTopFragment#newInstance} factory method to
|
||||
|
@ -35,6 +42,24 @@ public class SettingTopFragment extends Fragment {
|
|||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
return inflater.inflate(R.layout.fragment_setting_top, container, false);
|
||||
View view = inflater.inflate(R.layout.fragment_setting_top, container, false);
|
||||
|
||||
// Setting items
|
||||
ArrayList<SettingListItem> settingListItems = new ArrayList<>();
|
||||
settingListItems.add(
|
||||
new SettingListItem(
|
||||
"About",
|
||||
"About this app",
|
||||
ContextCompat.getDrawable(getContext(), one.nem.lacerta.shared.ui.R.drawable.save_24px),
|
||||
R.id.action_settingTopFragment_to_settingAboutPageFragment
|
||||
)
|
||||
);
|
||||
|
||||
// Init RecyclerView
|
||||
RecyclerView recyclerView = view.findViewById(R.id.setting_item_recycler_view);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
recyclerView.setAdapter(new ListItemAdapter(settingListItems));
|
||||
|
||||
return view;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user