mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 09:43:15 +00:00
途中
This commit is contained in:
parent
59a35cbb4a
commit
f186064f6e
|
@ -4,6 +4,7 @@
|
||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
|
<option name="testRunner" value="GRADLE" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
<option name="gradleJvm" value="jbr-17" />
|
<option name="gradleJvm" value="jbr-17" />
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|
|
@ -14,5 +14,7 @@ public class LacertaApplication extends Application {
|
||||||
|
|
||||||
// DynamicColorを有効化
|
// DynamicColorを有効化
|
||||||
DynamicColors.applyToActivitiesIfAvailable(this);
|
DynamicColors.applyToActivitiesIfAvailable(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,8 @@ public class MainActivity extends AppCompatActivity {
|
||||||
NavigationUI.setupWithNavController(bottomNavigationView, navController);
|
NavigationUI.setupWithNavController(bottomNavigationView, navController);
|
||||||
|
|
||||||
Toast.makeText(this, "testMessage", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "testMessage", Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
|
id 'com.google.dagger.hilt.android'
|
||||||
id 'com.android.library'
|
id 'com.android.library'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,4 +51,6 @@ dependencies {
|
||||||
|
|
||||||
//model
|
//model
|
||||||
implementation project(':model')
|
implementation project(':model')
|
||||||
|
|
||||||
|
implementation "androidx.recyclerview:recyclerview:1.3.2"
|
||||||
}
|
}
|
|
@ -22,5 +22,7 @@ public class ExampleInstrumentedTest {
|
||||||
// Context of the app under test.
|
// Context of the app under test.
|
||||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||||
assertEquals("one.nem.lacerta.feature.home.test", appContext.getPackageName());
|
assertEquals("one.nem.lacerta.feature.home.test", appContext.getPackageName());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,18 +3,36 @@ package one.nem.lacerta.feature.home;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
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 javax.inject.Inject;
|
||||||
|
|
||||||
|
import one.nem.lacerta.data.Document;
|
||||||
|
import one.nem.lacerta.model.document.DocumentMeta;
|
||||||
|
import one.nem.lacerta.model.document.tag.DocumentTag;
|
||||||
|
|
||||||
|
|
||||||
|
import dagger.hilt.android.AndroidEntryPoint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple {@link Fragment} subclass.
|
* A simple {@link Fragment} subclass.
|
||||||
* Use the {@link HomeTopFragment#newInstance} factory method to
|
* Use the {@link HomeTopFragment#newInstance} factory method to
|
||||||
* create an instance of this fragment.
|
* create an instance of this fragment.
|
||||||
*/
|
*/
|
||||||
|
@AndroidEntryPoint
|
||||||
public class HomeTopFragment extends Fragment {
|
public class HomeTopFragment extends Fragment {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
Document document;
|
||||||
|
|
||||||
// TODO: Rename parameter arguments, choose names that match
|
// TODO: Rename parameter arguments, choose names that match
|
||||||
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
||||||
private static final String ARG_PARAM1 = "param1";
|
private static final String ARG_PARAM1 = "param1";
|
||||||
|
@ -59,6 +77,14 @@ public class HomeTopFragment 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_home_top, container, false);
|
View view = inflater.inflate(R.layout.fragment_home_top, container, false);
|
||||||
|
|
||||||
|
ArrayList<DocumentMeta> metas = document.getAllDocumentMetas(100);
|
||||||
|
|
||||||
|
Log.d("docs", Integer.toString(metas.size()));
|
||||||
|
|
||||||
|
return view;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package one.nem.lacerta.feature.home;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import one.nem.lacerta.model.document.DocumentMeta;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class MyAdapter extends RecyclerView.Adapter<MyAdapter.MyAdapterViewHolder> {
|
||||||
|
public MyAdapter(List<DocumentMeta> documentMeta) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public MyAdapterViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull MyAdapterViewHolder holder, int position) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MyAdapterViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
public MyAdapterViewHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package one.nem.lacerta.feature.home;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
public class myfragment extends Fragment {
|
||||||
|
private RecyclerView recyclerView;
|
||||||
|
private RecyclerView.Adapter mAdapter;
|
||||||
|
private RecyclerView.LayoutManager layoutManager;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_home_top, container, false);
|
||||||
|
|
||||||
|
recyclerView = view.findViewById(R.id.recycler_view);
|
||||||
|
recyclerView.setHasFixedSize(true);
|
||||||
|
|
||||||
|
layoutManager = new LinearLayoutManager(getActivity());
|
||||||
|
recyclerView.setLayoutManager(layoutManager);
|
||||||
|
|
||||||
|
Object myDataset = 100;
|
||||||
|
mAdapter = new MyAdapter(myDataset);
|
||||||
|
recyclerView.setAdapter(mAdapter);
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,12 +3,17 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".HomeTopFragment">
|
tools:context=".HomeTopFragment"
|
||||||
|
tools:ignore="ExtraText">
|
||||||
|
|
||||||
|
|
||||||
<!-- TODO: Update blank fragment layout -->
|
<!-- TODO: Update blank fragment layout -->
|
||||||
<TextView
|
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"/>
|
||||||
android:text="@string/hello_blank_fragment" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
4
feature/home/src/main/res/values/ids.xml
Normal file
4
feature/home/src/main/res/values/ids.xml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<item name="my_recycler_view" type="id" />
|
||||||
|
</resources>
|
2
feature/home/src/main/res/values/refs.xml
Normal file
2
feature/home/src/main/res/values/refs.xml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources></resources>
|
Loading…
Reference in New Issue
Block a user