Skip to content

Commit

Permalink
Application theme - Final pass - Version 053b
Browse files Browse the repository at this point in the history
Changes in the layout files and corresponding attributes in Styles.xml.
The changes are part of v053b release.

Still more changes needs to be done in order to make the theme
more generic.
  • Loading branch information
hussainmohd-a committed Mar 2, 2021
1 parent e052e05 commit 12cc2bf
Show file tree
Hide file tree
Showing 53 changed files with 685 additions and 355 deletions.
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
android:roundIcon="@drawable/ic_launcher"
android:supportsRtl="true"
android:name=".RethinkDnsApplication"
android:theme="@style/AppTheme">
android:theme="@style/AppThemeInitial">
<meta-data
android:name="android.webkit.WebView.MetricsOptOut"
android:value="true" />
Expand All @@ -47,6 +47,7 @@
android:launchMode="singleTask" />
<activity
android:name=".ui.WelcomeActivity"
android:noHistory="true"
android:launchMode="singleTask"/>
<activity
android:name=".ui.AppInfoActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class UniversalBlockedRulesAdapter(
R.layout.univ_whitelist_rules_item,
parent, false
)
v.setBackgroundColor(context.getColor(R.color.colorPrimary))
return UniversalBlockedConnViewHolder(v)
}

Expand Down
32 changes: 20 additions & 12 deletions app/src/main/java/com/celzero/bravedns/ui/WelcomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ import org.koin.android.ext.android.inject
class WelcomeActivity : AppCompatActivity(R.layout.activity_welcome) {
private val b by viewBinding(ActivityWelcomeBinding::bind)
private lateinit var dots: Array<TextView?>
internal val layout: IntArray = intArrayOf(R.layout.welcome_slide1, R.layout.welcome_slide2)
internal val layout: IntArray = intArrayOf(R.layout.welcome_slide2, R.layout.welcome_slide1)

private lateinit var myPagerAdapter: PagerAdapter

private val persistentState by inject<PersistentState>()

override fun onCreate(savedInstanceState: Bundle?) {
Expand Down Expand Up @@ -72,28 +71,37 @@ class WelcomeActivity : AppCompatActivity(R.layout.activity_welcome) {
}

b.btnNext.setOnClickListener {
val currentItem = getItem(1)
if (currentItem < layout.size) b.viewPager.currentItem = currentItem
else launchHomeScreen()
val currentItem = getItem()
if (currentItem+1 >= layout.size) {
launchHomeScreen()
}else {
b.viewPager.currentItem = currentItem+1
}
}

b.viewPager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrollStateChanged(state: Int) {
if (ViewPager.SCROLLBAR_POSITION_RIGHT == state + 1) {
if (getItem(1) == layout.size) launchHomeScreen()
}
}

override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {

}

override fun onPageSelected(position: Int) {
addBottomDots(position)
if (position >= layout.size - 1) {
b.btnNext.text = getString(R.string.finish)
b.btnNext.visibility = View.VISIBLE
b.btnSkip.visibility = View.INVISIBLE
}else{
b.btnSkip.visibility = View.VISIBLE
b.btnNext.visibility = View.INVISIBLE
}
}

})
}

override fun onBackPressed() {
return
}

private fun Context.isDarkThemeOn(): Boolean {
Expand Down Expand Up @@ -127,8 +135,8 @@ class WelcomeActivity : AppCompatActivity(R.layout.activity_welcome) {
}
}

private fun getItem(i: Int): Int {
return b.viewPager.currentItem + i
private fun getItem(): Int {
return b.viewPager.currentItem
}

private fun launchHomeScreen() {
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/bs_dns_home_screen.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="18dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM18.92,8h-2.95c-0.32,-1.25 -0.78,-2.45 -1.38,-3.56 1.84,0.63 3.37,1.91 4.33,3.56zM12,4.04c0.83,1.2 1.48,2.53 1.91,3.96h-3.82c0.43,-1.43 1.08,-2.76 1.91,-3.96zM4.26,14C4.1,13.36 4,12.69 4,12s0.1,-1.36 0.26,-2h3.38c-0.08,0.66 -0.14,1.32 -0.14,2 0,0.68 0.06,1.34 0.14,2L4.26,14zM5.08,16h2.95c0.32,1.25 0.78,2.45 1.38,3.56 -1.84,-0.63 -3.37,-1.9 -4.33,-3.56zM8.03,8L5.08,8c0.96,-1.66 2.49,-2.93 4.33,-3.56C8.81,5.55 8.35,6.75 8.03,8zM12,19.96c-0.83,-1.2 -1.48,-2.53 -1.91,-3.96h3.82c-0.43,1.43 -1.08,2.76 -1.91,3.96zM14.34,14L9.66,14c-0.09,-0.66 -0.16,-1.32 -0.16,-2 0,-0.68 0.07,-1.35 0.16,-2h4.68c0.09,0.65 0.16,1.32 0.16,2 0,0.68 -0.07,1.34 -0.16,2zM14.59,19.56c0.6,-1.11 1.06,-2.31 1.38,-3.56h2.95c-0.96,1.65 -2.49,2.93 -4.33,3.56zM16.36,14c0.08,-0.66 0.14,-1.32 0.14,-2 0,-0.68 -0.06,-1.34 -0.14,-2h3.38c0.16,0.64 0.26,1.31 0.26,2s-0.1,1.36 -0.26,2h-3.38z"
android:fillColor="?attr/svgStrokeColor"/>
</vector>
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/bs_firewall_home_screen.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="18dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M19.35,10.04C18.67,6.59 15.64,4 12,4 9.11,4 6.6,5.64 5.35,8.04 2.34,8.36 0,10.91 0,14c0,3.31 2.69,6 6,6h13c2.76,0 5,-2.24 5,-5 0,-2.64 -2.05,-4.78 -4.65,-4.96zM19,18H6c-2.21,0 -4,-1.79 -4,-4s1.79,-4 4,-4h0.71C7.37,7.69 9.48,6 12,6c3.04,0 5.5,2.46 5.5,5.5v0.5H19c1.66,0 3,1.34 3,3s-1.34,3 -3,3z"
android:fillColor="?attr/svgStrokeColor"/>
</vector>
3 changes: 3 additions & 0 deletions app/src/main/res/drawable/ic_app_update.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,22 @@
android:pathData="M12,3L12,16"
android:strokeWidth="2"
android:strokeColor="?attr/svgStrokeColor"
android:strokeAlpha="0.5"
android:strokeLineCap="square"
android:strokeLineJoin="miter" />
<path
android:fillColor="?attr/svgFillColor"
android:pathData="M7,12l5,5l5,-5"
android:strokeWidth="2"
android:strokeAlpha="0.5"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="square"
android:strokeLineJoin="miter" />
<path
android:fillColor="?attr/svgFillColor"
android:pathData="M20,21L4,21"
android:strokeWidth="2"
android:strokeAlpha="0.5"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="square"
android:strokeLineJoin="miter" />
Expand Down
30 changes: 16 additions & 14 deletions app/src/main/res/drawable/ic_blog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,6s-2,-2 -4,-2 -5,2 -5,2v14s3,-2 5,-2 4,2 4,2c1.333,-1.333 2.667,-2 4,-2 1.333,0 3,0.667 5,2V6c-2,-1.333 -3.667,-2 -5,-2 -1.333,0 -2.667,0.667 -4,2z"
android:strokeLineJoin="miter"
android:strokeWidth="2"
android:fillColor="?attr/svgFillColor"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="square"/>
<path
android:pathData="M12,6v14"
android:strokeLineJoin="miter"
android:strokeWidth="2"
android:fillColor="?attr/svgFillColor"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="round"/>
<path
android:fillColor="?attr/svgFillColor"
android:pathData="M12,6s-2,-2 -4,-2 -5,2 -5,2v14s3,-2 5,-2 4,2 4,2c1.333,-1.333 2.667,-2 4,-2 1.333,0 3,0.667 5,2V6c-2,-1.333 -3.667,-2 -5,-2 -1.333,0 -2.667,0.667 -4,2z"
android:strokeWidth="2"
android:strokeAlpha="0.5"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="square"
android:strokeLineJoin="miter" />
<path
android:fillColor="?attr/svgFillColor"
android:pathData="M12,6v14"
android:strokeWidth="2"
android:strokeAlpha="0.5"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
</vector>
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/ic_dns_firewall.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="40dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M19,14.7368C19,17.1228 16.6667,19.2105 12,21C7.3333,19.2105 5,17.1228 5,14.7368C5,12.3509 5,9.3684 5,5.7895C8.1361,4.5965 10.4694,4 12,4C13.5306,4 15.8639,4.5965 19,5.7895C19,9.3684 19,12.3509 19,14.7368Z"
android:strokeLineJoin="miter"
android:strokeWidth="2"
android:fillColor="?attr/svgFillColor"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="square"/>
</vector>
6 changes: 3 additions & 3 deletions app/src/main/res/drawable/ic_fab_appinfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
android:strokeLineJoin="miter"
android:strokeWidth="1"
android:fillColor="#00000000"
android:strokeColor="?attr/colorCheckSelected"
android:strokeColor="?attr/accentGood"
android:strokeLineCap="square"/>
<path
android:pathData="M12,9L12,9"
android:strokeLineJoin="miter"
android:strokeWidth="1"
android:fillColor="#00000000"
android:strokeColor="?attr/colorCheckSelected"
android:strokeColor="?attr/accentGood"
android:strokeLineCap="square"/>
<path
android:pathData="M12,12m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0"
android:strokeLineJoin="miter"
android:strokeWidth="1"
android:fillColor="#00000000"
android:strokeColor="?attr/colorCheckSelected"
android:strokeColor="?attr/accentGood"
android:strokeLineCap="square"/>
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_fab_uninstall.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
android:strokeLineJoin="miter"
android:strokeWidth="1"
android:fillColor="#00000000"
android:strokeColor="?attr/colorCheckSelected"
android:strokeColor="?attr/accentGood"
android:strokeLineCap="square"/>
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_fab_without_border.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
android:strokeLineJoin="miter"
android:strokeWidth="1"
android:fillColor="?attr/svgFillColor"
android:strokeColor="?attr/primaryTextColor"
android:strokeColor="@color/white"
android:strokeLineCap="square"/>
</vector>
45 changes: 24 additions & 21 deletions app/src/main/res/drawable/ic_faq.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,14C12,12 13.576,11.6653 14.1187,11.124 14.6631,10.5809 15,9.8298 15,9 15,7.3431 13.6569,6 12,6 11.1041,6 10.2999,6.3927 9.7502,7.0154 9.496,7.3033 9.2962,7.6404 9.167,8.0106"
android:strokeLineJoin="miter"
android:strokeWidth="2"
android:fillColor="?attr/svgFillColor"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="square"/>
<path
android:pathData="M12,17L12,17"
android:strokeLineJoin="miter"
android:strokeWidth="2"
android:fillColor="?attr/svgFillColor"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="square"/>
<path
android:pathData="M12,12m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0"
android:strokeLineJoin="miter"
android:strokeWidth="2"
android:fillColor="?attr/svgFillColor"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="square"/>
<path
android:fillColor="?attr/svgFillColor"
android:pathData="M12,14C12,12 13.576,11.6653 14.1187,11.124 14.6631,10.5809 15,9.8298 15,9 15,7.3431 13.6569,6 12,6 11.1041,6 10.2999,6.3927 9.7502,7.0154 9.496,7.3033 9.2962,7.6404 9.167,8.0106"
android:strokeWidth="2"
android:strokeAlpha="0.5"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="square"
android:strokeLineJoin="miter" />
<path
android:fillColor="?attr/svgFillColor"
android:pathData="M12,17L12,17"
android:strokeWidth="2"
android:strokeAlpha="0.5"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="square"
android:strokeLineJoin="miter" />
<path
android:fillColor="?attr/svgFillColor"
android:pathData="M12,12m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0"
android:strokeWidth="2"
android:strokeAlpha="0.5"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="square"
android:strokeLineJoin="miter" />
</vector>
1 change: 1 addition & 0 deletions app/src/main/res/drawable/ic_github.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
android:strokeWidth="2"
android:fillColor="?attr/svgFillColor"
android:strokeColor="?attr/svgStrokeColor"
android:strokeAlpha="0.5"
android:strokeLineCap="round"/>
</vector>
30 changes: 16 additions & 14 deletions app/src/main/res/drawable/ic_mail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M4,4h16c1.1,0 2,0.9 2,2v12c0,1.1 -0.9,2 -2,2H4c-1.1,0 -2,-0.9 -2,-2V6c0,-1.1 0.9,-2 2,-2z"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="?attr/svgFillColor"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="round"/>
<path
android:pathData="M22,6l-10,7l-10,-7"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="?attr/svgFillColor"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="round"/>
<path
android:fillColor="?attr/svgFillColor"
android:pathData="M4,4h16c1.1,0 2,0.9 2,2v12c0,1.1 -0.9,2 -2,2H4c-1.1,0 -2,-0.9 -2,-2V6c0,-1.1 0.9,-2 2,-2z"
android:strokeWidth="2"
android:strokeAlpha="0.5"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:fillColor="?attr/svgFillColor"
android:pathData="M22,6l-10,7l-10,-7"
android:strokeWidth="2"
android:strokeAlpha="0.5"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>
15 changes: 8 additions & 7 deletions app/src/main/res/drawable/ic_twitter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M23,3a10.9,10.9 0,0 1,-3.14 1.53,4.48 4.48,0 0,0 -7.86,3v1A10.66,10.66 0,0 1,3 4s-4,9 5,13a11.64,11.64 0,0 1,-7 2c9,5 20,0 20,-11.5a4.5,4.5 0,0 0,-0.08 -0.83A7.72,7.72 0,0 0,23 3z"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="?attr/svgFillColor"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="round"/>
<path
android:fillColor="?attr/svgFillColor"
android:pathData="M23,3a10.9,10.9 0,0 1,-3.14 1.53,4.48 4.48,0 0,0 -7.86,3v1A10.66,10.66 0,0 1,3 4s-4,9 5,13a11.64,11.64 0,0 1,-7 2c9,5 20,0 20,-11.5a4.5,4.5 0,0 0,-0.08 -0.83A7.72,7.72 0,0 0,23 3z"
android:strokeWidth="2"
android:strokeAlpha="0.5"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>
3 changes: 3 additions & 0 deletions app/src/main/res/drawable/ic_website.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@
android:pathData="M12,12m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0"
android:strokeWidth="2"
android:strokeColor="?attr/svgStrokeColor"
android:strokeAlpha="0.5"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:fillColor="?attr/svgFillColor"
android:pathData="M2,12L22,12"
android:strokeWidth="2"
android:strokeColor="?attr/svgStrokeColor"
android:strokeAlpha="0.5"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:fillColor="?attr/svgFillColor"
android:pathData="M12,2a15.3,15.3 0,0 1,4 10,15.3 15.3,0 0,1 -4,10 15.3,15.3 0,0 1,-4 -10,15.3 15.3,0 0,1 4,-10z"
android:strokeWidth="2"
android:strokeColor="?attr/svgStrokeColor"
android:strokeAlpha="0.5"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>
1 change: 1 addition & 0 deletions app/src/main/res/drawable/ic_whats_new.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
android:pathData="M12,17.844l-5.817,3.058l1.111,-6.477l-4.706,-4.587l6.504,-0.945l2.908,-5.893l2.908,5.893l6.504,0.945l-4.706,4.587l1.111,6.477z"
android:strokeLineJoin="miter"
android:strokeWidth="2"
android:strokeAlpha="0.5"
android:fillColor="?attr/svgFillColor"
android:strokeColor="?attr/svgStrokeColor"
android:strokeLineCap="square"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
android:shape="rectangle">
<solid android:color="?attr/mainButtonBackground" />
<stroke
android:width="0.5dp"
android:width="0.75dp"
android:color="@color/border_color" />
<corners android:radius="5dp" />
</shape>
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_faq_webview_layout.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/webview_placeholder"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
Expand Down

0 comments on commit 12cc2bf

Please sign in to comment.