Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 0e1f7ef

Browse files
authored
Merge pull request #8 from Lennoard/FEATURE-redesign
Release v3.0.0
2 parents 74fe24c + e3b6e59 commit 0e1f7ef

20 files changed

Lines changed: 187 additions & 64 deletions

File tree

.gitignore

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,55 @@ app/src/main/main.iml
1111
HEBFOptimizer.iml
1212
.vs/*
1313
.idea/gradle.xml
14+
15+
# Node artifact files
16+
node_modules/
17+
18+
# Compiled Java class files
19+
*.class
20+
21+
# Log files
22+
*.log
23+
24+
# Maven
25+
target/
26+
dist/
27+
28+
# Unit test reports
29+
TEST*.xml
30+
31+
# OS-specific files
32+
.DS_Store
33+
.DS_Store?
34+
._*
35+
.Spotlight-V100
36+
.Trashes
37+
ehthumbs.db
38+
Thumbs.db
39+
40+
# Files for the ART/Dalvik VM
41+
*.dex
42+
43+
# Android Studio Navigation editor temp files
44+
.navigation/
45+
46+
# Android Studio captures folder
47+
captures/
48+
49+
*.iml
50+
.gradle
51+
/local.properties
52+
/build
53+
/captures
54+
55+
# Version control
56+
vcs.xml
57+
58+
# lint
59+
lint/intermediates/
60+
lint/generated/
61+
lint/outputs/
62+
lint/tmp/
63+
64+
#Signing config
65+
/keystore.properties

app/build.gradle.kts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import org.jetbrains.kotlin.config.KotlinCompilerVersion
2+
import java.util.Properties
23

34
plugins {
45
id("com.android.application")
@@ -35,11 +36,35 @@ android {
3536
multiDexEnabled = true
3637
}
3738

39+
signingConfigs {
40+
create("release") {
41+
val keyFile = rootProject.file("keystore.properties")
42+
if (!keyFile.exists()) {
43+
keyFile.createNewFile()
44+
keyFile.writeText(buildString {
45+
appendln("keyAlias=")
46+
appendln("keyPassword=")
47+
appendln("storeFile=/")
48+
appendln("storePassword=")
49+
})
50+
}
51+
val keystoreProps = Properties().apply {
52+
load(keyFile.inputStream())
53+
}
54+
55+
keyAlias = keystoreProps["keyAlias"] as? String ?: ""
56+
keyPassword = keystoreProps["keyPassword"] as? String ?: ""
57+
storeFile = file(keystoreProps["storeFile"] as? String ?: "/")
58+
storePassword = keystoreProps["storePassword"] as? String ?: ""
59+
}
60+
}
61+
3862
buildTypes {
3963
getByName("release") {
4064
isDebuggable = false
4165
isMinifyEnabled = true
4266
isShrinkResources = true
67+
signingConfig = signingConfigs.getByName("release")
4368
proguardFiles(
4469
getDefaultProguardFile("proguard-android-optimize.txt"),
4570
"proguard-rules.pro",

app/src/main/java/com/androidvip/hebf/ui/appintro/AppIntroActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import android.widget.*
1212
import androidx.appcompat.widget.Toolbar
1313
import androidx.core.content.ContextCompat
1414
import androidx.core.content.res.ResourcesCompat
15+
import androidx.core.view.ViewCompat
1516
import androidx.fragment.app.Fragment
1617
import androidx.fragment.app.FragmentManager
1718
import androidx.fragment.app.FragmentStatePagerAdapter
@@ -47,6 +48,7 @@ class AppIntroActivity : BaseActivity() {
4748
setSupportActionBar(toolbar)
4849
supportActionBar?.setDisplayHomeAsUpEnabled(false)
4950
supportActionBar?.setDisplayShowTitleEnabled(false)
51+
ViewCompat.setElevation(toolbar, 0F)
5052

5153
val tempFolder = K.HEBF.getTempDir(this)
5254
if (!tempFolder.exists()) {
@@ -63,7 +65,7 @@ class AppIntroActivity : BaseActivity() {
6365
titleTextSwitcher.setFactory {
6466
val textView = TextView(this).apply {
6567
textSize = 30f
66-
setTextColor(Color.WHITE)
68+
setTextColor(ContextCompat.getColor(context, R.color.colorOnSurface))
6769
}
6870

6971
val layoutParams = FrameLayout.LayoutParams(

app/src/main/java/com/androidvip/hebf/views/DashCard.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class DashCard @JvmOverloads constructor(
2121
context: Context,
2222
attrs: AttributeSet? = null,
2323
defStyle: Int = 0
24-
) : MaterialCardView(context, attrs, defStyle) {
24+
) : LinearLayout(context, attrs, defStyle) {
2525

2626
private val titleTextView: AppCompatTextView by lazy { findViewById(R.id.dashCardTitle) }
2727
private val valueTextView: AppCompatTextView by lazy { findViewById(R.id.dashCardValue) }

app/src/main/java/com/androidvip/hebf/views/ServiceState.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import androidx.core.content.ContextCompat
1111
import androidx.core.view.forEach
1212
import androidx.core.widget.ImageViewCompat
1313
import com.androidvip.hebf.R
14+
import com.androidvip.hebf.createVectorDrawable
1415
import com.androidvip.hebf.runOnMainThread
1516
import com.google.android.material.switchmaterial.SwitchMaterial
1617
import com.topjohnwu.superuser.ShellUtils
@@ -50,8 +51,15 @@ class ServiceState @JvmOverloads constructor(
5051
}
5152
}
5253

53-
val icon = attributes.getDrawable(R.styleable.ServiceState_serviceIcon)
54-
this.icon.setImageDrawable(icon)
54+
runCatching {
55+
val icon = attributes.getDrawable(R.styleable.ServiceState_serviceIcon)
56+
this.icon.setImageDrawable(icon)
57+
}.onFailure {
58+
val iconId = attributes.getResourceId(
59+
R.styleable.ServiceState_serviceIcon, R.drawable.ic_settings
60+
)
61+
this.icon.setImageDrawable(context.createVectorDrawable(iconId))
62+
}
5563
} finally {
5664
attributes.recycle()
5765
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24"
6+
android:tint="?attr/colorControlNormal">
7+
<path
8+
android:fillColor="@android:color/white"
9+
android:pathData="M8.7,15.9L4.8,12l3.9,-3.9c0.39,-0.39 0.39,-1.01 0,-1.4 -0.39,-0.39 -1.01,-0.39 -1.4,0l-4.59,4.59c-0.39,0.39 -0.39,1.02 0,1.41l4.59,4.6c0.39,0.39 1.01,0.39 1.4,0 0.39,-0.39 0.39,-1.01 0,-1.4zM15.3,15.9l3.9,-3.9 -3.9,-3.9c-0.39,-0.39 -0.39,-1.01 0,-1.4 0.39,-0.39 1.01,-0.39 1.4,0l4.59,4.59c0.39,0.39 0.39,1.02 0,1.41l-4.59,4.6c-0.39,0.39 -1.01,0.39 -1.4,0 -0.39,-0.39 -0.39,-1.01 0,-1.4z"/>
10+
</vector>

app/src/main/res/layout/activity_about.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
android:background="@color/colorSurface"
2222
app:layout_collapseMode="pin"
2323
app:popupTheme="@style/AppTheme.PopupOverlay"
24-
app:titleTextColor="@color/colorOnBackground"
25-
app:title="@string/sobre" />
24+
app:title="@string/sobre"
25+
app:titleTextColor="@color/colorOnBackground" />
2626

2727
</com.google.android.material.appbar.AppBarLayout>
2828

@@ -85,13 +85,22 @@
8585
android:layout_height="wrap_content"
8686
android:layout_marginTop="@dimen/small_margin"
8787
android:layout_marginEnd="@dimen/default_margin"
88-
android:paddingBottom="@dimen/default_margin"
8988
android:text="@string/hebf_sobre_sub"
9089
android:textAppearance="@style/TextAppearance.HEBF.Body2"
9190
app:layout_constraintEnd_toEndOf="parent"
9291
app:layout_constraintStart_toStartOf="@+id/card_img_hebf"
9392
app:layout_constraintTop_toBottomOf="@+id/appCompatTextView4" />
9493

94+
<com.google.android.material.button.MaterialButton
95+
style="@style/AppMaterialButtonFlatColored"
96+
android:layout_width="wrap_content"
97+
android:layout_height="wrap_content"
98+
android:text="@string/source_code"
99+
app:icon="@drawable/ic_code"
100+
android:layout_marginBottom="@dimen/default_margin"
101+
app:layout_constraintBottom_toBottomOf="parent"
102+
app:layout_constraintEnd_toEndOf="@+id/card_text_sobre"
103+
app:layout_constraintTop_toBottomOf="@+id/card_text_sobre" />
95104

96105
</androidx.constraintlayout.widget.ConstraintLayout>
97106

app/src/main/res/layout/activity_app_intro.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
android:layout_height="?attr/actionBarSize"
4747
android:background="@color/colorBackground"
4848
app:layout_collapseMode="pin"
49+
android:elevation="0dp"
4950
app:popupTheme="@style/AppTheme.PopupOverlay" />
5051

5152
</com.google.android.material.appbar.CollapsingToolbarLayout>
@@ -55,7 +56,7 @@
5556
<RelativeLayout
5657
android:layout_width="match_parent"
5758
android:layout_height="match_parent"
58-
android:layout_marginTop="240dp">
59+
android:layout_marginTop="@dimen/collapsing_app_bar_height">
5960

6061
<com.androidvip.hebf.views.CustomViewPager
6162
android:id="@+id/intro_pager"

app/src/main/res/layout/fragment_battery.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
android:layout_marginRight="@dimen/default_margin"
2323
android:outlineSpotShadowColor="@color/colorPrimary"
2424
app:cardElevation="@dimen/default_margin_alt"
25+
app:cardPreventCornerOverlap="false"
2526
app:layout_constraintTop_toTopOf="parent">
2627

2728
<androidx.appcompat.widget.AppCompatImageView
@@ -162,8 +163,11 @@
162163
android:layout_marginTop="@dimen/default_margin"
163164
android:layout_marginRight="@dimen/default_margin"
164165
android:outlineSpotShadowColor="@color/colorPrimary"
166+
android:visibility="gone"
165167
app:cardElevation="@dimen/default_margin_alt"
166-
app:layout_constraintTop_toBottomOf="@id/lowRamFlag">
168+
app:cardPreventCornerOverlap="false"
169+
app:layout_constraintTop_toBottomOf="@id/lowRamFlag"
170+
tools:visibility="visible">
167171

168172
<androidx.appcompat.widget.AppCompatImageView
169173
android:layout_width="match_parent"
Lines changed: 24 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,31 @@
1-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2-
xmlns:tools="http://schemas.android.com/tools"
1+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
32
xmlns:app="http://schemas.android.com/apk/res-auto"
43
android:layout_width="match_parent"
54
android:layout_height="match_parent"
6-
android:padding="4dp"
7-
android:animateLayoutChanges="true"
8-
tools:context=".ui.appintro.Intro1Fragment">
5+
android:orientation="vertical"
6+
android:padding="@dimen/medium_margin">
97

10-
<LinearLayout
11-
android:layout_width="match_parent"
12-
android:layout_height="match_parent"
13-
android:orientation="horizontal"
14-
android:padding="24dp"
15-
android:layout_above="@+id/layout_intro_bottom">
8+
<androidx.appcompat.widget.AppCompatImageView
9+
android:layout_width="wrap_content"
10+
android:layout_height="80dp"
11+
app:layout_constraintBottom_toTopOf="@+id/appCompatTextView3"
12+
app:layout_constraintEnd_toEndOf="parent"
13+
app:layout_constraintStart_toStartOf="parent"
14+
app:layout_constraintTop_toTopOf="parent"
15+
app:srcCompat="@drawable/__suicide"
16+
app:tint="?attr/colorOnSurface" />
1617

17-
<androidx.appcompat.widget.AppCompatImageView
18-
android:layout_width="match_parent"
19-
android:layout_height="80dp"
20-
android:layout_gravity="center"
21-
android:src="@drawable/__suicide"
22-
app:tint="?attr/colorOnSurface"/>
23-
24-
</LinearLayout>
25-
26-
<LinearLayout
27-
android:id="@+id/layout_intro_bottom"
28-
android:layout_width="match_parent"
18+
<androidx.appcompat.widget.AppCompatTextView
19+
android:id="@+id/appCompatTextView3"
20+
android:layout_width="wrap_content"
2921
android:layout_height="wrap_content"
30-
android:layout_alignParentBottom="true"
31-
android:layout_alignParentLeft="true"
32-
android:layout_alignParentStart="true"
33-
android:gravity="center"
34-
android:orientation="vertical"
35-
android:paddingBottom="8dp"
36-
android:paddingLeft="12dp"
37-
android:paddingRight="12dp">
38-
39-
<androidx.appcompat.widget.AppCompatTextView
40-
android:layout_width="wrap_content"
41-
android:layout_height="wrap_content"
42-
android:fontFamily="sans-serif-condensed"
43-
android:gravity="center_horizontal"
44-
android:textAppearance="@style/TextAppearance.HEBF.Body2"
45-
android:padding="4dp"
46-
android:text="@string/hebf_sobre_sub" />
47-
</LinearLayout>
48-
22+
android:fontFamily="sans-serif-condensed"
23+
android:gravity="center_horizontal"
24+
android:padding="4dp"
25+
android:text="@string/hebf_sobre_sub"
26+
android:textAppearance="@style/TextAppearance.HEBF.Body2"
27+
app:layout_constraintBottom_toBottomOf="parent"
28+
app:layout_constraintEnd_toEndOf="parent"
29+
app:layout_constraintStart_toStartOf="parent" />
4930

50-
</RelativeLayout>
31+
</androidx.constraintlayout.widget.ConstraintLayout>

0 commit comments

Comments
 (0)