Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #158(scrollbar issue) #309

Merged
merged 14 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,20 @@ class MainActivity : AppCompatActivity() {
viewModel.networkConnection.observe(this) { connected ->
Log.d(TAG, "Observing Network Connection.")
if (!connected) {
Snackbar.make(
binding.fragmentCoordinator, R.string.not_connected, Snackbar.LENGTH_LONG
).setAction(R.string.settings) {
try {
startActivity(Intent(Settings.ACTION_WIRELESS_SETTINGS))
} catch (ex: android.content.ActivityNotFoundException) {
Snackbar
.make(binding.fragmentCoordinator, R.string.not_connected, Snackbar.LENGTH_LONG)
.setAnchorView(binding.bottomNavView) // Snackbar will appear above bottom nav view
.setAction(R.string.settings) {
try {
startActivity(Intent(Settings.ACTION_WIFI_SETTINGS))
startActivity(Intent(Settings.ACTION_WIRELESS_SETTINGS))
} catch (ex: android.content.ActivityNotFoundException) {
startActivity(Intent(Settings.ACTION_SETTINGS))
try {
startActivity(Intent(Settings.ACTION_WIFI_SETTINGS))
} catch (ex: android.content.ActivityNotFoundException) {
startActivity(Intent(Settings.ACTION_SETTINGS))
}
}
}
}.show()
}.show()
}
}

Expand Down
104 changes: 51 additions & 53 deletions app/src/main/res/layout-land/fragment_about.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginBottom="80dp"
android:gravity="start"
tools:context=".fragments.about.AboutFragment"
tools:theme="@style/Theme.Exodus">
Expand All @@ -13,60 +14,57 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:title="@string/title_about" />

<LinearLayout
android:orientation="horizontal"
android:gravity="start"
android:baselineAligned="false"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:gravity="center"
android:paddingHorizontal="20dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/imageView"
android:layout_width="96dp"
android:layout_height="96dp"
android:contentDescription="@string/app_logo"
android:src="@drawable/ic_logo" />

<TextView
android:id="@+id/appNameTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textAlignment="center"
android:textColor="?android:textColorPrimary"
android:textSize="20sp" />
<ImageView
android:id="@+id/imageView"
android:layout_width="96dp"
android:layout_height="96dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar"
android:layout_marginStart="50dp"
android:contentDescription="@string/app_logo"
android:src="@drawable/ic_logo" />

<TextView
android:id="@+id/appVersionTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:textAlignment="center"
android:textColor="?android:textColorPrimary"
android:textSize="15sp" />

</LinearLayout>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/appNameTV"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="@id/imageView"
app:layout_constraintEnd_toEndOf="@id/imageView"
app:layout_constraintTop_toBottomOf="@id/imageView"
android:text="@string/app_name"
android:textAlignment="center"
android:textColor="?android:textColorPrimary"
android:textSize="20sp" />

<!--
Required ViewGroup for PreferenceFragmentCompat
False positive for id not in API < 24
-->
<FrameLayout
android:id="@android:id/list_container"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
tools:targetApi="n" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/appVersionTV"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="@id/imageView"
app:layout_constraintEnd_toEndOf="@id/imageView"
app:layout_constraintTop_toBottomOf="@id/appNameTV"
android:layout_marginTop="4dp"
android:textAlignment="center"
android:textColor="?android:textColorPrimary"
android:textSize="15sp" />

</LinearLayout>
<!--
Required ViewGroup for PreferenceFragmentCompat
False positive for id not in API < 24
-->
<FrameLayout
android:id="@android:id/list_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@id/imageView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar"
android:layout_marginStart="30dp"
tools:targetApi="n" />

</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
31 changes: 14 additions & 17 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fragmentCoordinator"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity"
tools:theme="@style/Theme.Exodus">

<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/fragmentCoordinator"
<androidx.fragment.app.FragmentContainerView
android:id="@+id/fragmentContainerView"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">

<androidx.fragment.app.FragmentContainerView
android:id="@+id/fragmentContainerView"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:navGraph="@navigation/navigation_resource" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
android:layout_height="match_parent"
app:defaultNavHost="true"
app:navGraph="@navigation/navigation_resource" />

<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottomNavView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:labelVisibilityMode="labeled"
app:menu="@menu/bottom_navigation" />
app:menu="@menu/bottom_navigation"
app:itemTextAppearanceActive="@style/Theme.Exodus.BottomNavTextActive"
app:itemTextAppearanceInactive="@style/Theme.Exodus.BottomNavTextInactive"/>

</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
71 changes: 38 additions & 33 deletions app/src/main/res/layout/fragment_a_d_trackers.xml
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:context=".fragments.appdetail.subfrags.ADTrackersFragment"
tools:theme="@style/Theme.Exodus">

<LinearLayout
android:id="@+id/trackerTitleTV"
android:layout_width="match_parent"
<com.google.android.material.chip.Chip
android:id="@+id/trackersChip"
style="@style/Theme.Exodus.Chip"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">

<com.google.android.material.chip.Chip
android:id="@+id/trackersChip"
style="@style/Theme.Exodus.Chip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:chipIcon="@drawable/ic_tracker"
tools:text="0" />
app:chipIcon="@drawable/ic_tracker"
tools:text="0" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/trackers"
android:textColor="?android:textColorPrimary"
android:textSize="18sp" />
</LinearLayout>
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@id/trackersChip"
app:layout_constraintTop_toTopOf="@id/trackersChip"
app:layout_constraintBottom_toBottomOf="@id/trackersChip"
android:layout_marginStart="8dp"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/trackers"
android:textColor="?android:textColorPrimary"
android:textSize="18sp" />

<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/trackersStatusTV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/trackerTitleTV"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/trackersChip"
android:layout_marginTop="5dp"
android:text="@string/code_signature_not_found"
android:textSize="15sp" />
Expand All @@ -45,25 +46,29 @@
android:id="@+id/trackersRV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/trackersStatusTV"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/trackersStatusTV"
android:layout_marginTop="10dp" />

<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/trackersInfoTV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/trackersRV"
android:layout_marginTop="15dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/trackersRV" android:layout_marginTop="15dp"
android:text="@string/tracker_info"
android:textSize="15sp" />

<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/trackersLearnTV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/trackersInfoTV"
android:text="@string/learn_more"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/trackersInfoTV" android:text="@string/learn_more"
android:textColor="?android:textColorPrimary"
android:textSize="15sp" />

</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
6 changes: 4 additions & 2 deletions app/src/main/res/layout/fragment_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="80dp"
android:gravity="center"
android:orientation="vertical"
tools:context=".fragments.about.AboutFragment"
Expand All @@ -22,7 +23,7 @@
android:contentDescription="@string/app_logo"
android:src="@drawable/ic_logo" />

<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/appNameTV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -31,10 +32,11 @@
android:textColor="?android:textColorPrimary"
android:textSize="20sp" />

<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/appVersionTV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="15dp"
android:textAlignment="center"
android:textColor="?android:textColorPrimary"
Expand Down
Loading