diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/BookMark/BookmarkAdapter.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/BookMark/BookmarkAdapter.java new file mode 100644 index 00000000..1ae51c2a --- /dev/null +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/BookMark/BookmarkAdapter.java @@ -0,0 +1,61 @@ +package one.nem.lacerta.component.viewer.BookMark; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + +import one.nem.lacerta.component.viewer.R; + + +public class BookmarkAdapter extends RecyclerView.Adapter { + + private List bookmarks; + private OnBookmarkClickListener listener; + + public BookmarkAdapter(List bookmarks, OnBookmarkClickListener listener) { + this.bookmarks = bookmarks; + this.listener = listener; + } + + @NonNull + @Override + public BookmarkViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.fragment_bookmark, parent, false); + return new BookmarkViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull BookmarkViewHolder holder, int position) { + final Bookmark bookmark = bookmarks.get(position); + + holder.titleTextView.setText(bookmark.getTitle()); + + holder.itemView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + // ブックマークがクリックされたときの処理 + listener.onBookmarkClick(bookmark); + } + }); + } + + @Override + public int getItemCount() { + return bookmarks.size(); + } + + static class BookmarkViewHolder extends RecyclerView.ViewHolder { + TextView titleTextView; + + public BookmarkViewHolder(@NonNull View itemView) { + super(itemView); + titleTextView = itemView.findViewById(R.id.titleTextView); + } + } +} diff --git a/lacerta/.gitignore b/lacerta/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/lacerta/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/lacerta/build.gradle b/lacerta/build.gradle new file mode 100644 index 00000000..f62c67d8 --- /dev/null +++ b/lacerta/build.gradle @@ -0,0 +1,39 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.lacerta' + compileSdk 33 + + defaultConfig { + applicationId "com.example.lacerta" + minSdk 26 + targetSdk 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'com.google.android.material:material:1.5.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' +} \ No newline at end of file diff --git a/lacerta/proguard-rules.pro b/lacerta/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/lacerta/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/lacerta/src/androidTest/java/com/example/lacerta/ExampleInstrumentedTest.java b/lacerta/src/androidTest/java/com/example/lacerta/ExampleInstrumentedTest.java new file mode 100644 index 00000000..f324dbfb --- /dev/null +++ b/lacerta/src/androidTest/java/com/example/lacerta/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.lacerta; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.example.lacerta", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/lacerta/src/main/AndroidManifest.xml b/lacerta/src/main/AndroidManifest.xml new file mode 100644 index 00000000..26c22686 --- /dev/null +++ b/lacerta/src/main/AndroidManifest.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/lacerta/src/main/res/drawable-v24/ic_launcher_foreground.xml b/lacerta/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 00000000..2b068d11 --- /dev/null +++ b/lacerta/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/lacerta/src/main/res/drawable/ic_launcher_background.xml b/lacerta/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 00000000..07d5da9c --- /dev/null +++ b/lacerta/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lacerta/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/lacerta/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 00000000..6f3b755b --- /dev/null +++ b/lacerta/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/lacerta/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/lacerta/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 00000000..6f3b755b --- /dev/null +++ b/lacerta/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/lacerta/src/main/res/mipmap-hdpi/ic_launcher.webp b/lacerta/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 00000000..c209e78e Binary files /dev/null and b/lacerta/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/lacerta/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/lacerta/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 00000000..b2dfe3d1 Binary files /dev/null and b/lacerta/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/lacerta/src/main/res/mipmap-mdpi/ic_launcher.webp b/lacerta/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 00000000..4f0f1d64 Binary files /dev/null and b/lacerta/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/lacerta/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/lacerta/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 00000000..62b611da Binary files /dev/null and b/lacerta/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/lacerta/src/main/res/mipmap-xhdpi/ic_launcher.webp b/lacerta/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 00000000..948a3070 Binary files /dev/null and b/lacerta/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/lacerta/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/lacerta/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..1b9a6956 Binary files /dev/null and b/lacerta/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/lacerta/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/lacerta/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 00000000..28d4b77f Binary files /dev/null and b/lacerta/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/lacerta/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/lacerta/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..9287f508 Binary files /dev/null and b/lacerta/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/lacerta/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/lacerta/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 00000000..aa7d6427 Binary files /dev/null and b/lacerta/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/lacerta/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/lacerta/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..9126ae37 Binary files /dev/null and b/lacerta/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/lacerta/src/main/res/values-night/themes.xml b/lacerta/src/main/res/values-night/themes.xml new file mode 100644 index 00000000..16186daf --- /dev/null +++ b/lacerta/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/lacerta/src/main/res/values/colors.xml b/lacerta/src/main/res/values/colors.xml new file mode 100644 index 00000000..c8524cd9 --- /dev/null +++ b/lacerta/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ + + + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/lacerta/src/main/res/values/strings.xml b/lacerta/src/main/res/values/strings.xml new file mode 100644 index 00000000..b3b9e87e --- /dev/null +++ b/lacerta/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + Lacerta + \ No newline at end of file diff --git a/lacerta/src/main/res/values/themes.xml b/lacerta/src/main/res/values/themes.xml new file mode 100644 index 00000000..f68409f7 --- /dev/null +++ b/lacerta/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/viewer/src/main/res/values/colors.xml b/viewer/src/main/res/values/colors.xml new file mode 100644 index 00000000..c8524cd9 --- /dev/null +++ b/viewer/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ + + + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/viewer/src/main/res/values/strings.xml b/viewer/src/main/res/values/strings.xml new file mode 100644 index 00000000..2c2e9f7c --- /dev/null +++ b/viewer/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + viewer + \ No newline at end of file diff --git a/viewer/src/main/res/values/themes.xml b/viewer/src/main/res/values/themes.xml new file mode 100644 index 00000000..f68409f7 --- /dev/null +++ b/viewer/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/viewer2/src/main/res/values/colors.xml b/viewer2/src/main/res/values/colors.xml new file mode 100644 index 00000000..c8524cd9 --- /dev/null +++ b/viewer2/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ + + + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/viewer2/src/main/res/values/strings.xml b/viewer2/src/main/res/values/strings.xml new file mode 100644 index 00000000..2c2e9f7c --- /dev/null +++ b/viewer2/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + viewer + \ No newline at end of file diff --git a/viewer2/src/main/res/values/themes.xml b/viewer2/src/main/res/values/themes.xml new file mode 100644 index 00000000..f68409f7 --- /dev/null +++ b/viewer2/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ + + + + +