From e1ad455f679c45b4de0191a959efb9ae2cf11c2b Mon Sep 17 00:00:00 2001 From: kubasz Date: Sat, 10 Aug 2019 22:03:11 +0200 Subject: [PATCH] First commit --- .gitignore | 13 ++ .idea/codeStyles/Project.xml | 113 ++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/encodings.xml | 4 + .idea/gradle.xml | 21 +++ .idea/misc.xml | 14 ++ .idea/runConfigurations.xml | 12 ++ app/.gitignore | 1 + app/build.gradle | 42 +++++ app/proguard-rules.pro | 21 +++ app/src/main/AndroidManifest.xml | 21 +++ .../utils/SwipeRefreshLayoutNoTouch.java | 52 ++++++ .../java/pl/szczodrzynski/navigation/Anim.kt | 170 +++++++++++++++++ .../szczodrzynski/navigation/MainActivity.kt | 81 +++++++++ .../navigation/ThemeInfoBottomSheetDialog.kt | 34 ++++ .../drawable-v24/ic_launcher_foreground.xml | 34 ++++ .../res/drawable/ic_launcher_background.xml | 170 +++++++++++++++++ app/src/main/res/drawable/shadow_right.xml | 10 + app/src/main/res/drawable/shadow_top.xml | 10 + app/src/main/res/layout/activity_main.xml | 7 + app/src/main/res/layout/sample_nav_view.xml | 27 +++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 2963 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 4905 bytes app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2060 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2783 bytes app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4490 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 6895 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 6387 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10413 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 9128 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 15132 bytes app/src/main/res/values/colors.xml | 8 + app/src/main/res/values/strings.xml | 3 + app/src/main/res/values/styles.xml | 18 ++ build.gradle | 46 +++++ gradle.properties | 21 +++ gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 54329 bytes gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 172 ++++++++++++++++++ gradlew.bat | 84 +++++++++ navlib/.gitignore | 1 + navlib/build.gradle | 33 ++++ navlib/consumer-rules.pro | 0 navlib/proguard-rules.pro | 21 +++ navlib/src/main/AndroidManifest.xml | 2 + .../main/java/pl/szczodrzynski/navlib/Anim.kt | 170 +++++++++++++++++ .../java/pl/szczodrzynski/navlib/NavView.kt | 113 ++++++++++++ .../drawable/bottom_sheet_controll_bar.xml | 9 + navlib/src/main/res/drawable/ic_android.xml | 9 + navlib/src/main/res/drawable/ic_light.xml | 9 + navlib/src/main/res/drawable/ic_night.xml | 9 + .../bottom_sheet_fragment_theme_info.xml | 52 ++++++ navlib/src/main/res/layout/nav_view.xml | 104 +++++++++++ navlib/src/main/res/values-w600dp/styles.xml | 6 + navlib/src/main/res/values/attrs_nav_view.xml | 8 + navlib/src/main/res/values/strings.xml | 3 + navlib/src/main/res/values/styles.xml | 12 ++ settings.gradle | 1 + 60 files changed, 1792 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/gradle.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/runConfigurations.xml create mode 100644 app/.gitignore create mode 100644 app/build.gradle create mode 100644 app/proguard-rules.pro create mode 100644 app/src/main/AndroidManifest.xml create mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/utils/SwipeRefreshLayoutNoTouch.java create mode 100644 app/src/main/java/pl/szczodrzynski/navigation/Anim.kt create mode 100644 app/src/main/java/pl/szczodrzynski/navigation/MainActivity.kt create mode 100644 app/src/main/java/pl/szczodrzynski/navigation/ThemeInfoBottomSheetDialog.kt create mode 100644 app/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 app/src/main/res/drawable/shadow_right.xml create mode 100644 app/src/main/res/drawable/shadow_top.xml create mode 100644 app/src/main/res/layout/activity_main.xml create mode 100644 app/src/main/res/layout/sample_nav_view.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/values/colors.xml create mode 100644 app/src/main/res/values/strings.xml create mode 100644 app/src/main/res/values/styles.xml create mode 100644 build.gradle create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 navlib/.gitignore create mode 100644 navlib/build.gradle create mode 100644 navlib/consumer-rules.pro create mode 100644 navlib/proguard-rules.pro create mode 100644 navlib/src/main/AndroidManifest.xml create mode 100644 navlib/src/main/java/pl/szczodrzynski/navlib/Anim.kt create mode 100644 navlib/src/main/java/pl/szczodrzynski/navlib/NavView.kt create mode 100644 navlib/src/main/res/drawable/bottom_sheet_controll_bar.xml create mode 100644 navlib/src/main/res/drawable/ic_android.xml create mode 100644 navlib/src/main/res/drawable/ic_light.xml create mode 100644 navlib/src/main/res/drawable/ic_night.xml create mode 100644 navlib/src/main/res/layout/bottom_sheet_fragment_theme_info.xml create mode 100644 navlib/src/main/res/layout/nav_view.xml create mode 100644 navlib/src/main/res/values-w600dp/styles.xml create mode 100644 navlib/src/main/res/values/attrs_nav_view.xml create mode 100644 navlib/src/main/res/values/strings.xml create mode 100644 navlib/src/main/res/values/styles.xml create mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2b75303 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..c33b7e4 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,113 @@ + + + + + + + + + +
+ + + + xmlns:android + ^$ + + + +
+
+ + + + xmlns:.* + ^$ + + + BY_NAME + +
+
+ + + + .*:id + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + ^$ + + + +
+
+ + + + style + ^$ + + + +
+
+ + + + .* + ^$ + + + BY_NAME + +
+
+ + + + .* + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + .* + + + BY_NAME + +
+
+
+
+ + +
+
\ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a62edad --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..8a8f75b --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..3282a54 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,42 @@ +apply plugin: 'com.android.application' + +apply plugin: 'kotlin-android' + +apply plugin: 'kotlin-android-extensions' + +android { + compileSdkVersion 28 + defaultConfig { + applicationId "pl.szczodrzynski.navigation" + minSdkVersion 16 + targetSdkVersion 28 + versionCode 1 + versionName "1.0" + } + 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 fileTree(dir: 'libs', include: ['*.jar']) + implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation 'androidx.appcompat:appcompat:1.0.2' + implementation "androidx.legacy:legacy-support-v4:1.0.0" + implementation "com.mikepenz:crossfader:1.6.0" // do not update + implementation "com.mikepenz:iconics-core:${iconics}" // do not update. >3.1.0 Breaks jelly bean + implementation "com.mikepenz:iconics-views:${iconics}" // do not update + implementation "com.mikepenz:community-material-typeface:3.5.95.1@aar" + implementation 'androidx.core:core-ktx:1.0.1' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + implementation "com.google.android.material:material:$material_version" + implementation project(":navlib") +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/app/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 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..9715f8e --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/utils/SwipeRefreshLayoutNoTouch.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/SwipeRefreshLayoutNoTouch.java new file mode 100644 index 0000000..8235ce5 --- /dev/null +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/SwipeRefreshLayoutNoTouch.java @@ -0,0 +1,52 @@ +package pl.szczodrzynski.edziennik.utils; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.MotionEvent; +import android.view.View; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.view.ViewCompat; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; + + +public class SwipeRefreshLayoutNoTouch extends SwipeRefreshLayout { + public SwipeRefreshLayoutNoTouch(@NonNull Context context) { + super(context); + } + + public SwipeRefreshLayoutNoTouch(@NonNull Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + } + + @Override + public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes) { + return false; + } + + @Override + public boolean onInterceptTouchEvent(MotionEvent ev) { + if (ev.getSource() == 0x10000000) { + // forward the event to super + return super.onInterceptTouchEvent(ev); + } + // discard all the other events + return false; + + /*if (ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == MotionEvent.ACTION_CANCEL) + return false; + super.onInterceptTouchEvent(ev); + return false;*/ + } + + @Override + public boolean onTouchEvent(MotionEvent ev) { + if (ev.getSource() == 0x10000000) { + // forward the event to super + return super.onTouchEvent(ev); + } + // discard all the other events + return false; + } +} diff --git a/app/src/main/java/pl/szczodrzynski/navigation/Anim.kt b/app/src/main/java/pl/szczodrzynski/navigation/Anim.kt new file mode 100644 index 0000000..5961027 --- /dev/null +++ b/app/src/main/java/pl/szczodrzynski/navigation/Anim.kt @@ -0,0 +1,170 @@ +package pl.szczodrzynski.navigation + +import android.view.View +import android.view.ViewGroup +import android.view.animation.AccelerateInterpolator +import android.view.animation.AlphaAnimation +import android.view.animation.Animation +import android.view.animation.DecelerateInterpolator +import android.view.animation.ScaleAnimation +import android.view.animation.Transformation +import android.widget.LinearLayout + +object Anim { + fun expand(v: View, duration: Int?, animationListener: Animation.AnimationListener?) { + v.measure(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT) + val targetHeight = v.measuredHeight + //Log.d("Anim", "targetHeight="+targetHeight); + v.visibility = View.VISIBLE + v.layoutParams.height = 0 + val a = object : Animation() { + override fun applyTransformation(interpolatedTime: Float, t: Transformation) { + v.layoutParams.height = if (interpolatedTime == 1.0f) + LinearLayout.LayoutParams.WRAP_CONTENT//(int)(targetHeight * interpolatedTime) + else + (targetHeight * interpolatedTime).toInt() + v.requestLayout() + } + + override fun willChangeBounds(): Boolean { + return true + } + } + if (duration == null) { + a.duration = (targetHeight.toFloat() / v.context.resources.displayMetrics.density).toInt().toLong() + } else { + a.duration = duration as Long + } + if (animationListener != null) { + a.setAnimationListener(animationListener) + } + v.startAnimation(a) + } + + fun collapse(v: View, duration: Int?, animationListener: Animation.AnimationListener?) { + val initialHeight = v.measuredHeight + val a = object : Animation() { + override fun applyTransformation(interpolatedTime: Float, t: Transformation) { + if (interpolatedTime == 1.0f) { + v.visibility = View.GONE + return + } + v.layoutParams.height = initialHeight - (initialHeight.toFloat() * interpolatedTime).toInt() + v.requestLayout() + } + + override fun willChangeBounds(): Boolean { + return true + } + } + if (duration == null) { + a.duration = (initialHeight.toFloat() / v.context.resources.displayMetrics.density).toInt().toLong() + } else { + a.duration = duration as Long + } + if (animationListener != null) { + a.setAnimationListener(animationListener) + } + v.startAnimation(a) + } + + fun fadeIn(v: View, duration: Int?, animationListener: Animation.AnimationListener?) { + val fadeIn = AlphaAnimation(0f, 1f) + fadeIn.interpolator = DecelerateInterpolator() //add this + fadeIn.duration = duration!!.toLong() + fadeIn.setAnimationListener(object : Animation.AnimationListener { + override fun onAnimationStart(animation: Animation) { + v.visibility = View.VISIBLE + animationListener?.onAnimationStart(animation) + } + + override fun onAnimationEnd(animation: Animation) { + animationListener?.onAnimationEnd(animation) + } + + override fun onAnimationRepeat(animation: Animation) { + animationListener?.onAnimationRepeat(animation) + } + }) + v.startAnimation(fadeIn) + } + + fun fadeOut(v: View, duration: Int?, animationListener: Animation.AnimationListener?) { + val fadeOut = AlphaAnimation(1f, 0f) + fadeOut.interpolator = AccelerateInterpolator() //and this + fadeOut.duration = duration!!.toLong() + fadeOut.setAnimationListener(object : Animation.AnimationListener { + override fun onAnimationStart(animation: Animation) { + animationListener?.onAnimationStart(animation) + } + + override fun onAnimationEnd(animation: Animation) { + v.visibility = View.INVISIBLE + animationListener?.onAnimationEnd(animation) + } + + override fun onAnimationRepeat(animation: Animation) { + animationListener?.onAnimationRepeat(animation) + } + }) + v.startAnimation(fadeOut) + } + + fun scaleView( + v: View, + duration: Int?, + animationListener: Animation.AnimationListener?, + startScale: Float, + endScale: Float + ) { + val anim = ScaleAnimation( + 1f, 1f, // Start and end values for the X axis scaling + startScale, endScale, // Start and end values for the Y axis scaling + Animation.RELATIVE_TO_SELF, 0f, // Pivot point of X scaling + Animation.RELATIVE_TO_SELF, 0f + ) // Pivot point of Y scaling + anim.fillAfter = true // Needed to keep the result of the animation + anim.duration = duration!!.toLong() + anim.setAnimationListener(object : Animation.AnimationListener { + override fun onAnimationStart(animation: Animation) { + animationListener?.onAnimationStart(animation) + } + + override fun onAnimationEnd(animation: Animation) { + animationListener?.onAnimationEnd(animation) + } + + override fun onAnimationRepeat(animation: Animation) { + animationListener?.onAnimationRepeat(animation) + } + }) + v.startAnimation(anim) + } + + class ResizeAnimation( + private val mView: View, + private val mFromWidth: Float, + private val mFromHeight: Float, + private val mToWidth: Float, + private val mToHeight: Float + ) : Animation() { + + private val width: Float + private val height: Float + + init { + width = mView.width.toFloat() + height = mView.height.toFloat() + duration = 300 + } + + override fun applyTransformation(interpolatedTime: Float, t: Transformation) { + val height = (mToHeight - mFromHeight) * interpolatedTime + mFromHeight + val width = (mToWidth - mFromWidth) * interpolatedTime + mFromWidth + val p = mView.layoutParams + p.width = (width * this.width).toInt() + p.height = (height * this.height).toInt() + mView.requestLayout() + } + } +} diff --git a/app/src/main/java/pl/szczodrzynski/navigation/MainActivity.kt b/app/src/main/java/pl/szczodrzynski/navigation/MainActivity.kt new file mode 100644 index 0000000..f69e815 --- /dev/null +++ b/app/src/main/java/pl/szczodrzynski/navigation/MainActivity.kt @@ -0,0 +1,81 @@ +package pl.szczodrzynski.navigation + +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.util.Log +import android.view.MotionEvent +import android.view.View +import com.google.android.material.bottomsheet.BottomSheetBehavior +import com.google.android.material.floatingactionbutton.FloatingActionButton +import android.widget.Toast +import androidx.core.widget.NestedScrollView +import com.google.android.material.bottomappbar.BottomAppBar + + +class MainActivity : AppCompatActivity() { + + var showing = false + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.sample_nav_view) + + /*val dim = findViewById(R.id.view) + + val nestedScrollView = findViewById(R.id.nestedScrollView) + val bottomSheetBehavior = BottomSheetBehavior.from(nestedScrollView) + + bottomSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN + + val fab = findViewById(R.id.floatingActionButton) + fab.setOnClickListener { + if (bottomSheetBehavior.state == BottomSheetBehavior.STATE_HIDDEN) { + bottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED + } + else { + bottomSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN + } + } + + dim.setOnClickListener { + + } + dim.setOnTouchListener { v, event -> + if (event.action == MotionEvent.ACTION_UP) { + bottomSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN + } + true + } + + val bottomAppBar = findViewById(R.id.bottomAppBar) + bottomAppBar.setOnTouchListener { v, event -> + Log.d("Main", "Y: ${event.y}, Raw Y: ${event.rawY}") + event.setLocation(event.rawX, event.rawY) + nestedScrollView.dispatchTouchEvent(event) + } + + bottomSheetBehavior.setBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() { + override fun onSlide(bottomSheet: View, slideOffset: Float) { + + } + + override fun onStateChanged(bottomSheet: View, newState: Int) { + when (newState) { + BottomSheetBehavior.STATE_HIDDEN -> { + if (showing) { + showing = false + Anim.fadeOut(dim, 300, null) + } + } + else -> { + if (!showing) { + showing = true + Anim.fadeIn(dim, 300, null) + } + } + } + //Toast.makeText(this@MainActivity, "Bottom Sheet State Changed to: $state", Toast.LENGTH_SHORT).show() + } + })*/ + } +} diff --git a/app/src/main/java/pl/szczodrzynski/navigation/ThemeInfoBottomSheetDialog.kt b/app/src/main/java/pl/szczodrzynski/navigation/ThemeInfoBottomSheetDialog.kt new file mode 100644 index 0000000..e56575a --- /dev/null +++ b/app/src/main/java/pl/szczodrzynski/navigation/ThemeInfoBottomSheetDialog.kt @@ -0,0 +1,34 @@ +package pl.szczodrzynski.navigation + +import android.app.Dialog +import android.view.LayoutInflater +import android.view.View +import androidx.fragment.app.FragmentManager +import com.google.android.material.bottomsheet.BottomSheetDialogFragment + +class ThemeInfoBottomSheetDialog : BottomSheetDialogFragment() { + + + override fun setupDialog(dialog: Dialog, style: Int) { + val view = LayoutInflater.from(requireContext()).inflate(R.layout.bottom_sheet_fragment_theme_info, null) + setupViews(view) + dialog.setContentView(view) + } + + private fun setupViews(view: View) { + + } + + fun showIfNeed(fragmentManager: FragmentManager) { + if (fragmentManager.findFragmentByTag(TAG) != null) { + return + } + show(fragmentManager, TAG) + } + + companion object { + private const val TAG = "ThemeInfoBottomSheetDialog" + + fun newInstance(): ThemeInfoBottomSheetDialog = ThemeInfoBottomSheetDialog() + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..1f6bb29 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..0d025f9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/shadow_right.xml b/app/src/main/res/drawable/shadow_right.xml new file mode 100644 index 0000000..b4f4b52 --- /dev/null +++ b/app/src/main/res/drawable/shadow_right.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shadow_top.xml b/app/src/main/res/drawable/shadow_top.xml new file mode 100644 index 0000000..6b2c04c --- /dev/null +++ b/app/src/main/res/drawable/shadow_top.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..f2a27f5 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,7 @@ + + diff --git a/app/src/main/res/layout/sample_nav_view.xml b/app/src/main/res/layout/sample_nav_view.xml new file mode 100644 index 0000000..0f7ee4c --- /dev/null +++ b/app/src/main/res/layout/sample_nav_view.xml @@ -0,0 +1,27 @@ + + + + +