Skip to content

Commit

Permalink
minor ui changes and string literals update
Browse files Browse the repository at this point in the history
  • Loading branch information
hussainmohd-a committed Jul 22, 2023
1 parent f788d54 commit 5ead9e3
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,8 @@ class DnsSettingsFragment :
private fun observeAppState() {
VpnController.connectionStatus.observe(viewLifecycleOwner) {
if (it == BraveVPNService.State.PAUSED) {
startActivity(
context?.let { it1 -> Intent().setClass(it1, PauseActivity::class.java) }
)
val intent = Intent(requireContext(), PauseActivity::class.java)
startActivity(intent)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,16 @@ import com.celzero.bravedns.util.Utilities.showToastUiCentered
import com.google.android.material.bottomnavigation.BottomNavigationView
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.snackbar.Snackbar
import java.io.File
import java.util.Calendar
import java.util.concurrent.Executor
import java.util.concurrent.TimeUnit
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.koin.android.ext.android.get
import org.koin.android.ext.android.inject
import java.io.File
import java.util.Calendar
import java.util.concurrent.Executor
import java.util.concurrent.TimeUnit


class HomeScreenActivity : AppCompatActivity(R.layout.activity_home_screen) {
private val b by viewBinding(ActivityHomeScreenBinding::bind)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,6 @@ class HomeScreenSettingBottomSheet : BottomSheetDialogFragment() {
handleDnsFirewallMode(checked)
}

b.bsHsWireguardRl.setOnClickListener {
showToastUiCentered(
requireContext(),
getString(R.string.coming_soon_toast),
Toast.LENGTH_SHORT
)
}

b.bsHomeScreenVpnLockdownDesc.setOnClickListener { openVpnProfile(requireContext()) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import android.widget.*
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
import androidx.annotation.RequiresApi
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.biometric.BiometricManager
Expand All @@ -40,8 +39,8 @@ import androidx.core.net.toUri
import androidx.core.os.LocaleListCompat
import androidx.lifecycle.lifecycleScope
import by.kirich1409.viewbindingdelegate.viewBinding
import com.celzero.bravedns.RethinkDnsApplication.Companion.DEBUG
import com.celzero.bravedns.R
import com.celzero.bravedns.RethinkDnsApplication.Companion.DEBUG
import com.celzero.bravedns.backup.BackupHelper
import com.celzero.bravedns.data.AppConfig
import com.celzero.bravedns.databinding.ActivityMiscSettingsBinding
Expand All @@ -56,13 +55,13 @@ import com.celzero.bravedns.util.Utilities.isAtleastT
import com.celzero.bravedns.util.Utilities.isFdroidFlavour
import com.celzero.bravedns.util.Utilities.showToastUiCentered
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import org.koin.android.ext.android.inject
import org.xmlpull.v1.XmlPullParser
import org.xmlpull.v1.XmlPullParserException
import java.io.*
import java.text.SimpleDateFormat
import java.util.*
import java.util.concurrent.TimeUnit
import org.koin.android.ext.android.inject
import org.xmlpull.v1.XmlPullParser
import org.xmlpull.v1.XmlPullParserException

class MiscSettingsActivity : AppCompatActivity(R.layout.activity_misc_settings) {
private val b by viewBinding(ActivityMiscSettingsBinding::bind)
Expand Down
71 changes: 0 additions & 71 deletions app/src/full/res/layout/bottom_sheet_home_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -265,77 +265,6 @@
android:padding="5dp"
android:text="" />
</RelativeLayout>

<RelativeLayout
android:id="@+id/bs_hs_wireguard_rl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingBottom="5dp">

<ImageView
android:id="@+id/wireguard_icon"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
android:clickable="false"
android:contentDescription="@string/apps_icon_content_desc"
android:padding="5dp"
android:src="@drawable/ic_vpn" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/bs_home_screen_radio_wireguard"
android:layout_toEndOf="@id/wireguard_icon"
android:alpha="0.5"
android:clickable="false"
android:orientation="vertical">

<TextView
android:id="@+id/wireguard_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/app_mode_wireguard"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/large_font_text_view" />

<TextView
android:id="@+id/wireguard_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/wireguard_mode_info_explanation_new"
android:textColor="?attr/primaryLightColorText"
android:textSize="@dimen/default_font_text_view" />
</LinearLayout>

<com.google.android.material.radiobutton.MaterialRadioButton
android:id="@+id/bs_home_screen_radio_wireguard"
style="@style/CustomWidget.MaterialComponents.CompoundButton.Switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_margin="5dp"
android:layoutDirection="rtl"
android:clickable="false"
android:padding="5dp"
android:text="" />
</RelativeLayout>
</RadioGroup>

<RelativeLayout
Expand Down
13 changes: 13 additions & 0 deletions app/src/full/res/layout/dialog_info_firewall_rules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@
android:textSize="@dimen/large_font_text_view"
app:drawableStartCompat="@drawable/ic_firewall_bypass_off" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:drawablePadding="10dp"
android:gravity="center_vertical"
android:padding="5dp"
android:text="@string/fapps_info_bypass_dns_firewall_msg"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/large_font_text_view"
app:drawableStartCompat="@drawable/ic_bypass_dns_firewall_off" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
32 changes: 11 additions & 21 deletions app/src/full/res/layout/dialog_set_custom_doh.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,20 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:textSize="@dimen/large_font_text_view"
android:text="@string/cd_doh_dialog_heading"
android:textSize="@dimen/large_font_text_view"
app:layout_constraintTop_toTopOf="parent" />

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/text_input_layout_name"
android:layout_width="match_parent"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
app:boxCornerRadiusBottomEnd="8dp"
app:boxCornerRadiusBottomStart="8dp"
app:boxCornerRadiusTopEnd="8dp"
app:boxCornerRadiusTopStart="8dp"
android:layout_marginTop="10dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/cd_doh_dialog_resolver_name"
app:hintTextColor="?attr/accentGood"
app:layout_constraintTop_toBottomOf="@id/dialog_custom_url_top">

<EditText
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/dialog_custom_name_edit_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
Expand All @@ -38,8 +33,8 @@
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:inputType="textNoSuggestions"
android:padding="10dp"
android:maxLines="2"
android:padding="10dp"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/large_font_text_view"
app:layout_constraintRight_toLeftOf="parent"
Expand All @@ -49,17 +44,12 @@
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/text_input_layout1"
android:layout_width="match_parent"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
app:boxCornerRadiusBottomEnd="8dp"
app:boxCornerRadiusBottomStart="8dp"
app:boxCornerRadiusTopEnd="8dp"
app:boxCornerRadiusTopStart="8dp"
android:layout_height="wrap_content"
android:hint="@string/cd_doh_dialog_resolver_url"
app:hintTextColor="?attr/accentGood"
app:layout_constraintTop_toBottomOf="@id/text_input_layout_name">

<EditText
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/dialog_custom_url_edit_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
Expand All @@ -68,11 +58,11 @@
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:inputType="textUri"
android:maxLines="2"
android:padding="10dp"
android:textSize="@dimen/large_font_text_view"
android:text="https://"
android:maxLines="2"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/large_font_text_view"
app:layout_constraintRight_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_input_layout_name" />
</com.google.android.material.textfield.TextInputLayout>
Expand All @@ -88,8 +78,8 @@
android:layout_marginBottom="10dp"
android:padding="5dp"
android:text="@string/settings_http_proxy_error_text4"
android:textSize="@dimen/default_font_text_view"
android:textColor="@color/colorRed_A400"
android:textSize="@dimen/default_font_text_view"
android:visibility="invisible"
app:layout_constraintTop_toBottomOf="@id/text_input_layout1" />

Expand All @@ -102,9 +92,9 @@
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:text="@string/cd_dialog_positive_btn"
android:textSize="@dimen/large_font_text_view"
android:text="@string/lbl_add"
android:textColor="?attr/accentGood"
android:textSize="@dimen/large_font_text_view"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/dialog_custom_url_failure_text" />

Expand All @@ -118,8 +108,8 @@
android:layout_marginBottom="10dp"
android:gravity="center"
android:text="@string/lbl_cancel"
android:textSize="@dimen/large_font_text_view"
android:textColor="?attr/accentGood"
android:textSize="@dimen/large_font_text_view"
app:layout_constraintEnd_toStartOf="@id/dialog_custom_url_ok_btn"
app:layout_constraintTop_toBottomOf="@id/dialog_custom_url_failure_text" />

Expand Down
17 changes: 1 addition & 16 deletions app/src/full/res/layout/dialog_set_dns_crypt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@
android:id="@+id/text_input_layout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
app:boxCornerRadiusBottomEnd="8dp"
app:boxCornerRadiusBottomStart="8dp"
app:boxCornerRadiusTopEnd="8dp"
app:boxCornerRadiusTopStart="8dp"
android:hint="@string/cd_dns_crypt_dialog_name"
app:hintTextColor="?attr/accentGood"
app:layout_constraintTop_toBottomOf="@id/dialog_dns_proxy_radio_group">
Expand All @@ -80,11 +75,6 @@
android:id="@+id/text_input_layout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
app:boxCornerRadiusBottomEnd="8dp"
app:boxCornerRadiusBottomStart="8dp"
app:boxCornerRadiusTopEnd="8dp"
app:boxCornerRadiusTopStart="8dp"
android:hint="@string/cd_dns_crypt_dialog_stamp"
app:hintTextColor="?attr/accentGood"
app:layout_constraintTop_toBottomOf="@id/text_input_layout1">
Expand All @@ -100,11 +90,6 @@
android:id="@+id/text_input_layout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
app:boxCornerRadiusBottomEnd="8dp"
app:boxCornerRadiusBottomStart="8dp"
app:boxCornerRadiusTopEnd="8dp"
app:boxCornerRadiusTopStart="8dp"
android:hint="@string/cd_dns_crypt_dialog_desc"
app:hintTextColor="?attr/accentGood"
app:layout_constraintTop_toBottomOf="@id/text_input_layout2">
Expand Down Expand Up @@ -138,7 +123,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="@string/cd_dialog_positive_btn"
android:text="@string/lbl_add"
android:textSize="@dimen/large_font_text_view"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/dialog_dns_crypt_scroll" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/full/res/layout/dialog_set_dns_proxy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:gravity="center"
android:text="@string/dns_proxy_positive_btn"
android:text="@string/lbl_add"
android:textSize="@dimen/large_font_text_view"
android:textColor="?attr/accentGood" />
</LinearLayout>
Expand Down
Loading

0 comments on commit 5ead9e3

Please sign in to comment.