proguard dict fix, added link preview coloring, layout fix

Signed-off-by: nuclearfog <hatespirit666@gmail.com>
This commit is contained in:
nuclearfog 2021-06-06 12:15:35 +02:00
parent 125a964410
commit bb15679a33
No known key found for this signature in database
GPG Key ID: AA0271FBE406DB98
8 changed files with 24 additions and 16 deletions

3
.gitignore vendored
View File

@ -6,4 +6,5 @@
/build
/captures
.externalNativeBuild
/app/release
/app/release
/app/dict

View File

@ -36,11 +36,11 @@ android {
}
}
proguardDictionaries{
dictionaryNames = ['show/class-dictionary', 'show/package-dictionary', 'show/obfuscation-dictionary']
proguardDictionaries {
dictionaryNames = ['dict/class-dictionary', 'dict/package-dictionary', 'dict/obfuscation-dictionary']
minLineLength 1 // minimum package name length
maxLineLength 6 // maximum package name length
linesCountInDictionary 2500 // maximum class count
linesCountInDictionary 3000 // maximum class count
}
dependencies {

View File

@ -33,6 +33,6 @@
-adaptclassstrings javax.management.DynamicMBean
# use dictionaries to create random package names
-obfuscationdictionary build/obfuscation-dictionary.txt
-classobfuscationdictionary build/class-dictionary.txt
-packageobfuscationdictionary build/package-dictionary.txt
-obfuscationdictionary dict/obfuscation-dictionary.txt
-classobfuscationdictionary dict/class-dictionary.txt
-packageobfuscationdictionary dict/package-dictionary.txt

View File

@ -771,7 +771,7 @@ public class GlobalSettings {
loadAnswer = settings.getBoolean(ANSWER_LOAD, false);
hqImages = settings.getBoolean(IMAGE_QUALITY, false);
toolbarOverlap = settings.getBoolean(PROFILE_OVERLAP, true);
linkPreview = settings.getBoolean(LINK_PREVIEW, true);
linkPreview = settings.getBoolean(LINK_PREVIEW, false);
customAPIKey = settings.getBoolean(CUSTOM_CONSUMER_KEY_SET, false);
api_key1 = settings.getString(CUSTOM_CONSUMER_KEY_1, "");
api_key2 = settings.getString(CUSTOM_CONSUMER_KEY_2, "");

View File

@ -162,4 +162,4 @@ public class ConfirmDialog extends AlertDialog implements OnClickListener {
*/
void onConfirm(DialogType type);
}
}
}

View File

@ -56,6 +56,7 @@ public class LinkDialog extends Dialog implements LinkPreviewCallback, OnClickLi
GlobalSettings settings = GlobalSettings.getInstance(context);
AppStyles.setProgressColor(loading, settings.getHighlightColor());
AppStyles.setDrawableColor(close, Color.BLACK);
title.setTextColor(Color.BLUE);
textCrawler = new TextCrawler();
close.setOnClickListener(this);
@ -91,10 +92,15 @@ public class LinkDialog extends Dialog implements LinkPreviewCallback, OnClickLi
@Override
public void onPos(SourceContent sourceContent, boolean b) {
loading.setVisibility(View.INVISIBLE);
if (sourceContent.isSuccess())
if (sourceContent.isSuccess()) {
title.setText(sourceContent.getTitle());
else
title.setText(url);
} else {
if (url.startsWith("https://")) {
title.setText(url.substring(8));
} else {
title.setText(url);
}
}
description.setText(sourceContent.getDescription());
if (!sourceContent.getImages().isEmpty()) {
Picasso.get().load(sourceContent.getImages().get(0)).into(preview);

View File

@ -2,7 +2,8 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:padding="@dimen/dialog_linkpreview_padding">
<ImageView
android:id="@+id/link_preview_image"
@ -19,9 +20,9 @@
android:id="@+id/link_preview_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="@dimen/dialog_linkpreview_textsize_title"
android:singleLine="true"
android:layout_margin="@dimen/dialog_linkpreview_margin"
android:maxLines="2"
android:textSize="@dimen/dialog_linkpreview_textsize_title"
app:layout_constraintStart_toEndOf="@id/link_preview_image"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toStartOf="@id/link_preview_close" />
@ -34,7 +35,6 @@
android:layout_margin="@dimen/dialog_linkpreview_margin"
app:layout_constraintStart_toEndOf="@id/link_preview_title"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="@id/link_preview_title"
app:layout_constraintEnd_toEndOf="parent" />
<androidx.constraintlayout.widget.Barrier

View File

@ -210,5 +210,6 @@
<dimen name="dialog_linkpreview_textsize_description">14sp</dimen>
<dimen name="dialog_linkpreview_btn_size">30sp</dimen>
<dimen name="dialog_linkpreview_margin">4dp</dimen>
<dimen name="dialog_linkpreview_padding">5dp</dimen>
</resources>