Skip to content

Commit

Permalink
disclaimer: refactor to fragment with navigation (fixes #2571) (#2573)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
Okuro3499 and dogi authored Oct 5, 2023
1 parent 0e668eb commit 108f7a4
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 27 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 21
targetSdkVersion 34
versionCode 1080
versionName "0.10.80"
versionCode 1081
versionName "0.10.81"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@
android:name=".ui.news.NewsDetailActivity"
android:label="@string/title_activity_news_detail"
android:theme="@style/MyMaterialTheme.NoActionBar" />
<activity
android:name=".ui.dashboard.DisclaimerActivity"
android:theme="@style/AppTheme" />
<activity
android:name=".ui.myhealth.AddMyHealthActivity"
android:theme="@style/AppTheme" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public boolean onMenuItemClick(MenuItem item) {
startActivity(new Intent(DashboardActivity.this, SettingActivity.class));
break;
case R.id.action_disclaimer:
startActivity(new Intent(DashboardActivity.this, DisclaimerActivity.class));
openCallFragment(new DisclaimerFragment());
break;
case R.id.action_about:
openCallFragment(new AboutFragment());
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.ole.planet.myplanet.ui.dashboard

import android.os.Build
import android.os.Bundle
import android.text.Html
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.RequiresApi
import androidx.core.text.HtmlCompat
import androidx.fragment.app.Fragment
import org.ole.planet.myplanet.databinding.FragmentDisclaimerBinding
import org.ole.planet.myplanet.utilities.Constants

class DisclaimerFragment : Fragment() {
private lateinit var fragmentDisclaimerBinding: FragmentDisclaimerBinding
@RequiresApi(Build.VERSION_CODES.N)
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
fragmentDisclaimerBinding = FragmentDisclaimerBinding.inflate(inflater, container, false)
fragmentDisclaimerBinding.tvDisclaimer.text = Html.fromHtml(getString(Constants.DISCLAIMER), HtmlCompat.FROM_HTML_MODE_LEGACY)
return fragmentDisclaimerBinding.root
}
}
14 changes: 14 additions & 0 deletions app/src/main/res/layout/fragment_disclaimer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/padding_normal"
tools:context=".ui.dashboard.DisclaimerFragment">

<TextView
android:id="@+id/tv_disclaimer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/md_black_1000" />
</androidx.core.widget.NestedScrollView>

0 comments on commit 108f7a4

Please sign in to comment.