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

Translate app to Persian #10

Open
wants to merge 73 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
42d4af4
Translate app to Persian
AlirezaIvaz Aug 26, 2021
f03ed3a
Create README.md
AlirezaIvaz May 20, 2023
811bc0e
Upgrade Gradle from 6.6.1 to 8.1
AlirezaIvaz May 20, 2023
57ad7c9
Define repositories in settings.gradle (As of new structure)
AlirezaIvaz May 20, 2023
3c2394b
Upgrade Android Gradle Plugin from `4.2.0-alpha12 to 8.2.0-alpha04` a…
AlirezaIvaz May 20, 2023
5d0c65b
Upgrade target sdk to api 33 (Android Tiramisu)
AlirezaIvaz May 20, 2023
6c08ae5
Merge remote-tracking branch 'origin/master'
AlirezaIvaz May 20, 2023
06e3be9
Remove redundant dependency
AlirezaIvaz May 20, 2023
ea7b5ea
Remove redundant repository declaration
AlirezaIvaz May 20, 2023
b597902
Define namespace for module instead of declaring package name in mani…
AlirezaIvaz May 20, 2023
d45f6f9
Apply plugins with newest method
AlirezaIvaz May 20, 2023
374e5b9
Upgrade Java version to Java 11
AlirezaIvaz May 20, 2023
bef82e1
Fix deprecations
AlirezaIvaz May 20, 2023
2d992e2
Update gradle.properties
AlirezaIvaz Jun 21, 2023
42f2a2d
Downgrade Android Gradle Plugin to 8.0.2 stable
AlirezaIvaz Jun 21, 2023
7ffaeec
Add Android 12 required `exported` attribute
AlirezaIvaz Jun 21, 2023
93f63b2
Fix compiler errors
AlirezaIvaz Jun 21, 2023
267f7d2
Upgrade dependencies
AlirezaIvaz Jun 21, 2023
705197c
Migrate to KotlinDSL and remove something
AlirezaIvaz Jun 21, 2023
73302a4
Fix deprecation
AlirezaIvaz Jun 21, 2023
54df51b
Remove redundant configs
AlirezaIvaz Jun 21, 2023
dd74b9b
Migrate to Gradle Version Catalog
AlirezaIvaz Jun 21, 2023
46e3653
Use lifecycle annotation processor
AlirezaIvaz Jun 21, 2023
3faba98
Upgrade target Java version to Java 17
AlirezaIvaz Jun 21, 2023
de4e06f
Move icons to the correct folder
AlirezaIvaz Jun 21, 2023
595f2b1
Change launcher icon, add support of adaptive and monochrome icon
AlirezaIvaz Jun 21, 2023
6df158f
Fix directory name
AlirezaIvaz Jun 21, 2023
acb0bc5
Migrate to Material 3
AlirezaIvaz Jun 21, 2023
2246492
Add splash screen
AlirezaIvaz Jun 21, 2023
62fc3a7
Move user to developer options to enable demo mode option
AlirezaIvaz Jun 21, 2023
0ccfebe
Cleanup codes
AlirezaIvaz Jun 21, 2023
432f930
Add ok button to permissions details dialog
AlirezaIvaz Jun 21, 2023
1cf3289
Add icon to permissions details dialog
AlirezaIvaz Jun 21, 2023
6166542
Use collapsing toolbar
AlirezaIvaz Jun 21, 2023
6c933ee
Add tabler icons
AlirezaIvaz Jun 21, 2023
382515d
Remove redundant function
AlirezaIvaz Jun 21, 2023
f899959
Add required dimens
AlirezaIvaz Jun 21, 2023
2ace7b0
Use nested scroll view as parent of fragment container
AlirezaIvaz Jun 21, 2023
1788a9c
Use tablericons
AlirezaIvaz Jun 21, 2023
bd1aab6
Replace preference with fab
AlirezaIvaz Jun 21, 2023
d1288ac
Remove unused colors
AlirezaIvaz Jun 21, 2023
83ad788
Fix splash screen bug
AlirezaIvaz Jun 22, 2023
d0bc5a0
Redesign the app
AlirezaIvaz Jun 22, 2023
41fdcd0
Fix todo
AlirezaIvaz Jun 22, 2023
4c1bdf8
Rename directory
AlirezaIvaz Jun 22, 2023
9dcf1bf
Rename directory and view model
AlirezaIvaz Jun 22, 2023
e3a16f2
Rename activity
AlirezaIvaz Jun 22, 2023
ebbd21f
Fix tile work issue in case of incorrect exported value
AlirezaIvaz Jun 22, 2023
dd781aa
Rename packages
AlirezaIvaz Jun 22, 2023
f0fd88e
Change versions
AlirezaIvaz Jun 22, 2023
8cb5299
Rename packages
AlirezaIvaz Jun 22, 2023
fcafd61
Organize imports
AlirezaIvaz Jun 22, 2023
9c9132a
Cleanup codes
AlirezaIvaz Jun 22, 2023
75f92ed
Add predictive back gesture support
AlirezaIvaz Jun 22, 2023
cb8d047
Localize strings
AlirezaIvaz Jun 22, 2023
75d9f06
Cleanup codes
AlirezaIvaz Jun 22, 2023
2f1da80
Improve turn on demo mode dialog
AlirezaIvaz Jun 22, 2023
ac1d73a
Rename string
AlirezaIvaz Jun 22, 2023
9e5ca9f
Rename resources
AlirezaIvaz Jun 22, 2023
6fdf79f
Remove redundant resources
AlirezaIvaz Jun 22, 2023
67a82ce
Rename resource
AlirezaIvaz Jun 22, 2023
7f7c8e7
Remove redundant resources
AlirezaIvaz Jun 22, 2023
acd13c0
Remove redundant resources
AlirezaIvaz Jun 22, 2023
6521674
Add support of grant permissions with root access
AlirezaIvaz Jun 22, 2023
dbf3894
Add round icon
AlirezaIvaz Jun 22, 2023
3babb83
Add backup support
AlirezaIvaz Jun 22, 2023
0467685
Add per-app languages support
AlirezaIvaz Jun 22, 2023
f182acb
Add share, rate and apps items to toolbar menu with support of multi …
AlirezaIvaz Jun 22, 2023
0f236a3
Use Poppins and Vazirmatn fonts
AlirezaIvaz Jun 22, 2023
98726cb
Change quick settings tile icons
AlirezaIvaz Jun 23, 2023
5a4aa57
Change launcher icon
AlirezaIvaz Jun 23, 2023
d1d21cd
Use with keyword to simplify codes
AlirezaIvaz Jun 27, 2023
5a1421e
Update README.md
AlirezaIvaz Jun 27, 2023
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
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# DemoModeTile

> Moved to [this repository](https://github.com/AlirezaIvaz/DemoMode).

You get a screenshot, you get a screenshot, everygets a screenshot!

It's a very simple tool presented as a Quick Tile to simplify the process of setting up and activating Demo Mode. It's already pre-configured out of the box with perfect 7:00 clock, full WiFi, full signal and full battery icons for stunning clutter-free screenshots.

For it to work you need to grant it two permissions through adb shell from your computer:

```
adb -d shell pm grant ir.alirezaivaz.demo_mode android.permission.DUMP
adb -d shell pm grant ir.alirezaivaz.demo_mode android.permission.WRITE_SECURE_SETTINGS
```

The `DUMP` permission is required for the Demo Mode to actually work, and the `WRITE_SECURE_SETTINGS` is necessary for the Quick Tile to read the setting and present the correct icon depending on its state.

Since these permissions can be a little scary, for transparency sake I've open sourced it https://github.com/franciscofranco/Demo-Mode-tile.
96 changes: 0 additions & 96 deletions app/build.gradle

This file was deleted.

143 changes: 143 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
plugins {
alias(libs.plugins.application)
alias(libs.plugins.kotlin)
kotlin("kapt")
}

val githubUrl = "https://github.com/AlirezaIvaz/DemoMode"

android {
namespace = "ir.alirezaivaz.demo_mode"
compileSdk = 33

defaultConfig {
applicationId = "ir.alirezaivaz.demo_mode"
minSdk = 24
targetSdk = 33
versionName = "1.0.0"
versionCode = 100
resourceConfigurations += arrayOf(
"en", "fa"
)
buildConfigField(
"String",
"GITHUB_REPO_URL",
"\"$githubUrl\""
)
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

lint {
abortOnError = false
checkAllWarnings = false
disable += "InvalidPackage"
}

packaging {
resources {
excludes += listOf(
"META-INF/LICENSE.txt",
"META-INF/NOTICE.txt"
)
}
}

buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}

flavorDimensions += "distributor"
productFlavors {
create("github") {
dimension = "distributor"
versionNameSuffix = "-GH"
buildConfigField(
"String",
"DOWNLOAD_LINK",
"\"$githubUrl\""
)
buildConfigField(
"String",
"RATE_INTENT",
"\"$githubUrl/issues\""
)
buildConfigField(
"String",
"APPS_INTENT",
"\"https://github.com/AlirezaIvaz\""
)
}
create("cafebazaar") {
dimension = "distributor"
versionNameSuffix = "-CB"
buildConfigField(
"String",
"DOWNLOAD_LINK",
"\"https://cafebazaar.ir/app/${defaultConfig.applicationId}\""
)
buildConfigField(
"String",
"RATE_INTENT",
"\"bazaar://details?id=${defaultConfig.applicationId}\""
)
buildConfigField(
"String",
"APPS_INTENT",
"\"bazaar://collection?slug=by_author&aid=alirezaivaz\""
)
}
create("myket") {
dimension = "distributor"
versionNameSuffix = "-MK"
buildConfigField(
"String",
"DOWNLOAD_LINK",
"\"https://myket.ir/app/${defaultConfig.applicationId}\""
)
buildConfigField(
"String",
"RATE_INTENT",
"\"myket://comment?id=${defaultConfig.applicationId}\""
)
buildConfigField(
"String",
"APPS_INTENT",
"\"myket://developer/${defaultConfig.applicationId}\""
)
}
}

buildFeatures {
buildConfig = true
viewBinding = true
}
kotlinOptions {
jvmTarget = "17"
}
}

dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.browser)
implementation(libs.androidx.fragment.ktx)
implementation(libs.androidx.lifecycle.livedata.ktx)
implementation(libs.androidx.lifecycle.viewmodel.ktx)
implementation(libs.androidx.preference.ktx)
implementation(libs.kotlinx.coroutines.core)
implementation(libs.material)
implementation(libs.tablericons)
kapt(libs.androidx.lifecycle.compiler)
}
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# By default, the flags in this file are appended to flags specified
# in /usr/local/opt/android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
# directive in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
19 changes: 19 additions & 0 deletions app/src/github/res/menu/main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_share"
android:icon="@drawable/ic_share"
android:title="@string/action_share"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_rate"
android:icon="@drawable/ic_bug"
android:title="@string/action_github_issues"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_apps"
android:icon="@drawable/ic_brand_github"
android:title="@string/action_github_profile"
app:showAsAction="ifRoom" />
</menu>
29 changes: 21 additions & 8 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.franco.demomode">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission
android:name="android.permission.DUMP"
Expand All @@ -11,23 +10,37 @@
tools:ignore="ProtectedPermissions" />

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:enableOnBackInvokedCallback="true"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:localeConfig="@xml/locales_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/DemoModeTheme">
android:theme="@style/Theme.DemoModeTile"
tools:targetApi="tiramisu">

<activity android:name=".activities.MainActivity">
<activity
android:name=".activities.ActivitySplash"
android:exported="true"
android:theme="@style/Theme.DemoModeTile.SplashScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".activities.ActivityMain"
android:exported="false" />

<service
android:name="com.franco.demomode.tiles.DemoModeTile"
android:icon="@drawable/ic_off"
android:label="@string/demo_mode"
android:name=".tiles.DemoModeTile"
android:exported="true"
android:icon="@drawable/ic_tilt_shift_off"
android:label="@string/action_demo_mode"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
Expand Down
Binary file added app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 0 additions & 51 deletions app/src/main/java/com/franco/demomode/activities/MainActivity.kt

This file was deleted.

Loading