テスト用にアイテム追加

This commit is contained in:
r-ca 2024-01-20 15:27:39 +09:00
parent 32cd27997c
commit db26e639e6
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -2,12 +2,19 @@ package one.nem.lacerta.setting;
import android.os.Bundle; import android.os.Bundle;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import java.util.ArrayList;
import one.nem.lacerta.setting.model.SettingListItem;
/** /**
* A simple {@link Fragment} subclass. * A simple {@link Fragment} subclass.
* Use the {@link SettingTopFragment#newInstance} factory method to * Use the {@link SettingTopFragment#newInstance} factory method to
@ -35,6 +42,24 @@ public class SettingTopFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
// Inflate the layout for this fragment // 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;
} }
} }