mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 09:43:15 +00:00
Fragmentの処理を実装 WIP
This commit is contained in:
parent
885f1b40c8
commit
87f6d582dc
|
@ -5,19 +5,30 @@ import android.os.Bundle;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.navigation.Navigation;
|
import androidx.navigation.Navigation;
|
||||||
|
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 android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import dagger.hilt.android.AndroidEntryPoint;
|
||||||
|
import one.nem.lacerta.data.LacertaLibrary;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple {@link Fragment} subclass.
|
* A simple {@link Fragment} subclass.
|
||||||
* Use the {@link SettingTagManageFragment#newInstance} factory method to
|
* Use the {@link SettingTagManageFragment#newInstance} factory method to
|
||||||
* create an instance of this fragment.
|
* create an instance of this fragment.
|
||||||
*/
|
*/
|
||||||
|
@AndroidEntryPoint
|
||||||
public class SettingTagManageFragment extends Fragment {
|
public class SettingTagManageFragment extends Fragment {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
LacertaLibrary lacertaLibrary;
|
||||||
|
|
||||||
public SettingTagManageFragment() {
|
public SettingTagManageFragment() {
|
||||||
// Required empty public constructor
|
// Required empty public constructor
|
||||||
}
|
}
|
||||||
|
@ -50,6 +61,20 @@ public class SettingTagManageFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
RecyclerView recyclerView = view.findViewById(R.id.tag_item_recycler_view);
|
||||||
|
TagListItemAdapter adapter = new TagListItemAdapter((tagId, tagName, tagColor) -> {
|
||||||
|
Toast.makeText(getContext(), "Tag Clicked", Toast.LENGTH_SHORT).show();
|
||||||
|
});
|
||||||
|
|
||||||
|
recyclerView.setAdapter(adapter);
|
||||||
|
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
|
|
||||||
|
lacertaLibrary.getTagList().thenAccept(documentTags -> {
|
||||||
|
adapter.setDocumentTags(documentTags);
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user