Skip to content

Commit

Permalink
Release 2.5.0
Browse files Browse the repository at this point in the history
[!] - Important note
[+] - Added
[-] - Bug fixed
[*] - Changed

--- [2.5.0] ---
[!] The design has been changed. Removed the side menu
[+] Material You
[*] Compatible with modern androids
[*] Layout fixes
[*] The application theme follows the system theme
[*] Language change removed, community translations added instead. Thanks to everyone who helped!
  • Loading branch information
SnowVolf committed Jan 11, 2023
1 parent 56fd352 commit 1c5f723
Show file tree
Hide file tree
Showing 235 changed files with 5,718 additions and 3,356 deletions.
3 changes: 2 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 15 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ plugins {


static def buildTime(){
def date = new Date().format("dd.MM.yyyy, HH:mm:ss")
def date = new Date().format("dd.MM.yyyy, HH:mm")
return date
}

android {
compileSdk 32
compileSdk 33
defaultConfig {
applicationId "ru.svolf.pcompiler"
minSdk 21
targetSdk 32
targetSdk 33
versionCode 25
versionName "2.5.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

resConfigs "en", "ar", "bn", "fa", "hi", "in", "it", "pt", "ru", "si", "tr", "vi"
}
signingConfigs {
release {
Expand All @@ -43,34 +45,35 @@ android {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

buildFeatures {
viewBinding = true
}

namespace 'ru.svolf.pcompiler'
}

dependencies {
// def latestFastAdapterRelease = '5.7.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.preference:preference:1.2.0'
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
testImplementation 'junit:junit:4.13.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.7.10"
implementation 'com.faendir:acra:4.10.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.17'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'com.squareup.okhttp3:okhttp:4.3.1'
// implementation "com.trello.rxlifecycle2:rxlifecycle:2.2.0"
// implementation "com.trello.rxlifecycle2:rxlifecycle-components:2.2.0"
// implementation "com.trello.rxlifecycle2:rxlifecycle-android:2.2.0"
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
implementation files('libs/zip4j_1.3.2.jar')
implementation project(":blurkit")
// implementation "com.mikepenz:fastadapter:${latestFastAdapterRelease}"
// implementation "com.mikepenz:fastadapter-extensions-binding:${latestFastAdapterRelease}" // view binding helpers
implementation "net.lingala.zip4j:zip4j:2.11.2"
implementation project(":backdrop")
implementation project(":core-ui")

}
Binary file removed app/libs/zip4j_1.3.2.jar
Binary file not shown.
6 changes: 1 addition & 5 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
#retrolambda
-dontwarn java.lang.invoke.*
-dontwarn **$$Lambda$*
#butterknife
-keep class butterknife.*
-keep public class * implements butterknife.Unbinder { public <init>(**, android.view.View); }
-keepclasseswithmembernames class * { @butterknife.* <methods>; }
-keepclasseswithmembernames class * { @butterknife.* <fields>; }

-dontwarn net.lingala.zip4j.**
#okhttp3
-keepattributes Signature
Expand Down
Binary file added app/release/app-release.apk
Binary file not shown.
20 changes: 20 additions & 0 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "ru.svolf.pcompiler",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 25,
"versionName": "2.5.0",
"outputFile": "app-release.apk"
}
],
"elementType": "File"
}
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ru.svolf.pcompiler">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>

<!-- For properly handle app update installation -->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/assets/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
[-] - Исправлена ошибка
[*] - Изменено

--- [2.5.0] ---
[!] Изменен дизайн. Удалено бокового меню
[+] Material You
[*] Совместимость с современными андроидами
[*] Фиксы разметки
[*] Тема приложения следует системной теме
[*] Удалена смена языка, взамен добавлены переводы от сообщества. Спасибо всем кто помогал!

--- [2.0.1] ---
[+] Счётчик вкладок
[-] Неправильная локаль при первом запуске
Expand Down
72 changes: 38 additions & 34 deletions app/src/main/java/ru/svolf/girl/ui/CodeText.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,27 @@

public class CodeText extends ShaderText {
private Context context;
private transient Paint paint = new Paint();
private transient Paint bgPaint = new Paint();
private final transient Paint paint = new Paint();
private final transient Paint bgPaint = new Paint();
private Layout layout;

public CodeText(Context context, AttributeSet attrs) {
super(context, attrs);

this.context = context;
bgPaint.setStyle(Paint.Style.FILL);
bgPaint.setColor(App.getColorFromAttr(getContext(), android.R.attr.windowBackground));

paint.setStyle(Paint.Style.FILL);
paint.setAntiAlias(true);
if (Preferences.INSTANCE.isMonospaceFontAllowed()){
setTypeface(ResourcesCompat.getFont(getContext(), R.font.mono));
if (!isInEditMode()) {
this.context = context;
bgPaint.setStyle(Paint.Style.FILL);
bgPaint.setColor(App.getColorFromAttr(getContext(), android.R.attr.windowBackground));

paint.setStyle(Paint.Style.FILL);
paint.setAntiAlias(true);
if (Preferences.INSTANCE.isMonospaceFontAllowed()) {
setTypeface(ResourcesCompat.getFont(getContext(), R.font.mono));
}
setTextSize(Preferences.INSTANCE.getFontSize());
paint.setColor(App.getColorFromAttr(getContext(), R.attr.icon_color));
paint.setTextSize(getPixels(14));
getViewTreeObserver().addOnGlobalLayoutListener(() -> layout = getLayout());
}
setTextSize(Preferences.INSTANCE.getFontSize());
paint.setColor(App.getColorFromAttr(getContext(), android.R.attr.textColor));
paint.setTextSize(getPixels(14));
getViewTreeObserver().addOnGlobalLayoutListener(() -> layout = getLayout());
}

private int getDigitCount() {
Expand All @@ -53,27 +54,30 @@ private int getDigitCount() {

@Override
protected void onDraw(Canvas canvas) {
int padding = (int) getPixels(getDigitCount() * 10 + 10);
setPadding(padding, 0, 0, 0);

int scrollY = getScrollY();
int firstLine = layout.getLineForVertical(scrollY), lastLine;

try {
lastLine = layout.getLineForVertical(scrollY + (getHeight() - getExtendedPaddingTop() - getExtendedPaddingBottom()));
} catch (NullPointerException npe) {
lastLine = layout.getLineForVertical(scrollY + (getHeight() - getPaddingTop() - getPaddingBottom()));
if (!isInEditMode()) {
int padding = (int) getPixels(getDigitCount() * 10 + 10);
setPadding(padding, 0, 0, 0);

int scrollY = getScrollY();
int firstLine = layout.getLineForVertical(scrollY), lastLine;

try {
lastLine = layout.getLineForVertical(scrollY + (getHeight() - getExtendedPaddingTop() - getExtendedPaddingBottom()));
} catch (NullPointerException npe) {
lastLine = layout.getLineForVertical(scrollY + (getHeight() - getPaddingTop() - getPaddingBottom()));
}

//the y position starts at the baseline of the first line
int positionY = getBaseline() + (layout.getLineBaseline(firstLine) - layout.getLineBaseline(0));
drawLineNumber(canvas, layout, positionY, firstLine);
for (int i = firstLine + 1; i <= lastLine; i++) {
//get the next y position using the difference between the current and last baseline
positionY += layout.getLineBaseline(i) - layout.getLineBaseline(i - 1);
drawLineNumber(canvas, layout, positionY, i);
}
}
super.onDraw(canvas);

//the y position starts at the baseline of the first line
int positionY = getBaseline() + (layout.getLineBaseline(firstLine) - layout.getLineBaseline(0));
drawLineNumber(canvas, layout, positionY, firstLine);
for (int i = firstLine + 1; i <= lastLine; i++) {
//get the next y position using the difference between the current and last baseline
positionY += layout.getLineBaseline(i) - layout.getLineBaseline(i - 1);
drawLineNumber(canvas, layout, positionY, i);
}
super.onDraw(canvas);
}

private void drawLineNumber(Canvas canvas, Layout layout, int positionY, int line) {
Expand Down
12 changes: 8 additions & 4 deletions app/src/main/java/ru/svolf/girl/ui/GirlEditText.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import android.content.Context;
import android.util.AttributeSet;
import android.widget.EditText;

import androidx.appcompat.widget.AppCompatEditText;
import androidx.core.content.res.ResourcesCompat;

import com.google.android.material.textfield.TextInputEditText;
Expand All @@ -14,7 +16,7 @@
* Created by Snow Volf on 25.09.2017, 21:02
*/

public class GirlEditText extends TextInputEditText {
public class GirlEditText extends AppCompatEditText {

public GirlEditText(Context context) {
super(context);
Expand All @@ -32,10 +34,12 @@ public GirlEditText(Context context, AttributeSet attrs, int defStyleAttr) {
}

private void init(){
if (Preferences.INSTANCE.isMonospaceFontAllowed()){
setTypeface(ResourcesCompat.getFont(getContext(), R.font.mono));
if (!isInEditMode()) {
if (Preferences.INSTANCE.isMonospaceFontAllowed()) {
setTypeface(ResourcesCompat.getFont(getContext(), R.font.mono));
}
setTextSize(Preferences.INSTANCE.getFontSize());
}
setTextSize(Preferences.INSTANCE.getFontSize());
}

public void clear(){
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/ru/svolf/girl/ui/GirlToolbar.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public GirlToolbar(Context context, @Nullable AttributeSet attrs, int defStyleAt
}

public View getTabIndicator() {
return getMenu().getItem(0).getActionView();
return getMenu().getItem(1).getActionView();
}

public void setTabIndicatorValue(int value){
Expand Down
9 changes: 4 additions & 5 deletions app/src/main/java/ru/svolf/pcompiler/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import io.reactivex.plugins.RxJavaPlugins;
import ru.svolf.girl.reactive.SimpleObservable;
import ru.svolf.pcompiler.util.Constants;
import ru.svolf.pcompiler.util.LocaleGirl;
import ru.svolf.pcompiler.util.RuntimeUtil;
import ru.svolf.pcompiler.util.StringWrapper;

Expand Down Expand Up @@ -110,10 +109,10 @@ public void onCreate() {
DynamicColors.applyToActivitiesIfAvailable(this);
}

@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(LocaleGirl.INSTANCE.onAttach(base, LocaleGirl.INSTANCE.getDefaultLocale().getLanguage()));
}
// @Override
// protected void attachBaseContext(Context base) {
// super.attachBaseContext(LocaleGirl.INSTANCE.onAttach(base, LocaleGirl.INSTANCE.getDefaultLocale().getLanguage()));
// }

public SharedPreferences getPreferences() {
if (preferences == null) {
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/ru/svolf/pcompiler/patch/PatchArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public void removeItemAt(String tabTag) {
}
}

public String getItem(String tabTag){
return get(tabTag);
}

public void setItemAt(String tabTag, ReactiveBuilder builder) {
try {
put(tabTag, builder.toString());
Expand All @@ -46,4 +50,5 @@ public void setItemAt(String tabTag, ReactiveBuilder builder) {
e.printStackTrace();
}
}

}
10 changes: 7 additions & 3 deletions app/src/main/java/ru/svolf/pcompiler/patch/ReactiveBuilder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ru.svolf.pcompiler.patch;

import android.util.Log;
import android.widget.EditText;

import ru.svolf.pcompiler.settings.Preferences;
Expand All @@ -9,16 +10,20 @@
*/

public class ReactiveBuilder {
private static final String TAG = "ReactiveBuilder";
private final StringBuilder mBuilder;

public ReactiveBuilder(){
Log.d(TAG, "ReactiveBuilder: create");
mBuilder = new StringBuilder();
}

// Generate a full patch string
public static StringBuilder build(){
Log.d(TAG, "build: call build");
StringBuilder str = new StringBuilder();
for (String s: PatchCollection.getCollection().values()) {
Log.d(TAG, "build: items = " + s);
str.append(s);
}
return str;
Expand Down Expand Up @@ -146,7 +151,7 @@ public ReactiveBuilder escapeComment(String comment){
// [ \t]*\\R[ \t]*

// Escape most common sub sequences with its escaped equivalents
private ReactiveBuilder escapeFind(String find){
private String escapeFind(String find){
if (Preferences.INSTANCE.isEscapeFindAllowed()) {
find = find
.replace(" .", " \\.")
Expand All @@ -161,8 +166,7 @@ private ReactiveBuilder escapeFind(String find){
.replace(System.lineSeparator(), "\\n ")
.replaceAll(RegexPattern.INSTANCE.getEIGHT_SPACES(), " ");
}
mBuilder.append(find);
return this;
return find;
}

@Override
Expand Down
Loading

0 comments on commit 1c5f723

Please sign in to comment.