1
0
mirror of https://framagit.org/tom79/nitterizeme synced 2025-02-10 00:30:55 +01:00

Add some descriptions

This commit is contained in:
Thomas 2020-01-25 15:51:45 +01:00
parent 0ce6fa8a2f
commit a6d7643791
6 changed files with 196 additions and 189 deletions

View File

@ -15,24 +15,24 @@ package app.fedilab.nitterizeme;
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
public class AppInfo { class AppInfo {
private String domain; private String domain;
private android.content.pm.ApplicationInfo ApplicationInfo; private android.content.pm.ApplicationInfo ApplicationInfo;
public String getDomain() { String getDomain() {
return domain; return domain;
} }
public void setDomain(String domain) { void setDomain(String domain) {
this.domain = domain; this.domain = domain;
} }
public android.content.pm.ApplicationInfo getApplicationInfo() { android.content.pm.ApplicationInfo getApplicationInfo() {
return ApplicationInfo; return ApplicationInfo;
} }
public void setApplicationInfo(android.content.pm.ApplicationInfo applicationInfo) { void setApplicationInfo(android.content.pm.ApplicationInfo applicationInfo) {
ApplicationInfo = applicationInfo; ApplicationInfo = applicationInfo;
} }
} }

View File

@ -67,8 +67,10 @@ public class AppInfoAdapter extends RecyclerView.Adapter {
holder.information.setText(appInfo.getApplicationInfo().packageName); holder.information.setText(appInfo.getApplicationInfo().packageName);
if( appInfo.getApplicationInfo().packageName.compareTo(BuildConfig.APPLICATION_ID) == 0 ) { if( appInfo.getApplicationInfo().packageName.compareTo(BuildConfig.APPLICATION_ID) == 0 ) {
holder.valid.setImageResource(R.drawable.ic_check); holder.valid.setImageResource(R.drawable.ic_check);
holder.valid.setContentDescription(context.getString(R.string.valid));
}else { }else {
holder.valid.setImageResource(R.drawable.ic_error); holder.valid.setImageResource(R.drawable.ic_error);
holder.valid.setContentDescription(context.getString(R.string.error));
} }
holder.main_container.setOnClickListener(v -> { holder.main_container.setOnClickListener(v -> {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
@ -79,6 +81,7 @@ public class AppInfoAdapter extends RecyclerView.Adapter {
}else{ }else{
holder.information.setText(R.string.no_apps); holder.information.setText(R.string.no_apps);
holder.app_icon.setImageResource(R.drawable.ic_android); holder.app_icon.setImageResource(R.drawable.ic_android);
holder.valid.setContentDescription(context.getString(R.string.warning));
holder.valid.setImageResource(R.drawable.ic_warning); holder.valid.setImageResource(R.drawable.ic_warning);
} }

View File

@ -21,6 +21,7 @@ import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import java.util.Objects;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -53,7 +54,7 @@ public class TransformActivity extends AppCompatActivity {
while (matcher.find()) { while (matcher.find()) {
final String youtubeId = matcher.group(3); final String youtubeId = matcher.group(3);
String invidiousHost = sharedpreferences.getString(MainActivity.SET_INVIDIOUS_HOST, MainActivity.DEFAULT_INVIDIOUS_HOST).toLowerCase(); String invidiousHost = sharedpreferences.getString(MainActivity.SET_INVIDIOUS_HOST, MainActivity.DEFAULT_INVIDIOUS_HOST).toLowerCase();
if (matcher.group(2) != null && matcher.group(2).compareTo("youtu.be") == 0) { if (Objects.requireNonNull(matcher.group(2)).compareTo("youtu.be") == 0) {
newUrl = "https://" + invidiousHost + "/watch?v=" + youtubeId + "&local=true"; newUrl = "https://" + invidiousHost + "/watch?v=" + youtubeId + "&local=true";
} else { } else {
newUrl = "https://" + invidiousHost + "/" + youtubeId + "&local=true"; newUrl = "https://" + invidiousHost + "/" + youtubeId + "&local=true";

View File

@ -23,212 +23,208 @@
android:scrollbars="none" android:scrollbars="none"
android:layout_margin="@dimen/fab_margin" android:layout_margin="@dimen/fab_margin"
tools:context=".AboutActivity"> tools:context=".AboutActivity">
<RelativeLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
<LinearLayout android:orientation="vertical">
<TextView
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:text="@string/app_name"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_marginTop="10dp"
android:id="@+id/about_version"
android:textSize="16sp"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_margin="5dp"
android:textStyle="bold"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:gravity="center"
<TextView android:text="@string/developer"
android:layout_marginTop="10dp" />
android:textSize="20sp"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:text="@string/app_name"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView <!-- Developer info -->
android:layout_marginTop="10dp" <androidx.cardview.widget.CardView
android:id="@+id/about_version" android:layout_width="match_parent"
android:textSize="16sp" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_marginBottom="10dp"
android:gravity="center_horizontal" android:layout_marginTop="10dp">
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
<TextView android:padding="5dp"
android:layout_margin="5dp"
android:textStyle="bold"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:orientation="horizontal"
android:text="@string/developer" android:baselineAligned="false">
/> <LinearLayout
android:layout_width="0dp"
<!-- Developer info --> android:layout_weight="1"
<androidx.cardview.widget.CardView android:layout_height="wrap_content"
android:layout_width="match_parent" android:orientation="vertical"
android:layout_height="wrap_content" tools:ignore="UseCompoundDrawables">
android:layout_marginBottom="10dp" <TextView
android:layout_marginTop="10dp"> android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="tom79"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/tom79_avatar"
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout <LinearLayout
android:padding="5dp" android:layout_width="0dp"
android:layout_width="match_parent" android:layout_weight="3"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="vertical">
android:baselineAligned="false"> <TextView
<LinearLayout android:textSize="16sp"
android:layout_width="0dp" android:id="@+id/developer_mastodon"
android:layout_weight="1" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:textStyle="bold"
tools:ignore="UseCompoundDrawables"> android:text="\@fedilab@toot.fedilab.org"
<TextView tools:ignore="HardcodedText" />
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="tom79"
android:textSize="16sp"
tools:ignore="HardcodedText" />
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/tom79_avatar"
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_marginTop="10dp"
android:layout_weight="3" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="horizontal">
<TextView <TextView
android:textSize="16sp" android:textSize="16sp"
android:id="@+id/developer_mastodon" android:id="@+id/framagit"
android:layout_width="match_parent" android:text="Framagit"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:layout_weight="1"
android:text="\@fedilab@toot.fedilab.org"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
<LinearLayout <TextView
android:layout_marginTop="10dp" android:textSize="16sp"
android:layout_width="match_parent" android:id="@+id/github"
android:text="Github"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:layout_weight="1"
<TextView tools:ignore="HardcodedText" />
android:textSize="16sp" <TextView
android:id="@+id/framagit" android:textSize="16sp"
android:text="Framagit" android:id="@+id/codeberg"
android:layout_width="0dp" android:text="Codeberg"
android:layout_height="wrap_content" android:layout_width="0dp"
android:layout_weight="1" android:layout_height="wrap_content"
tools:ignore="HardcodedText" /> android:layout_weight="1"
<TextView tools:ignore="HardcodedText" />
android:textSize="16sp"
android:id="@+id/github"
android:text="Github"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
tools:ignore="HardcodedText" />
<TextView
android:textSize="16sp"
android:id="@+id/codeberg"
android:text="Codeberg"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </LinearLayout>
<!-- Idea from info --> </androidx.cardview.widget.CardView>
<!-- Idea from info -->
<Button <Button
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/Donate" android:text="@string/Donate"
android:id="@+id/donate" android:id="@+id/donate"
/> />
<!-- About the app --> <!-- About the app -->
<TextView
android:layout_margin="10dp"
android:textStyle="bold"
android:textSize="16sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/about_the_app"
/>
<!-- Code info -->
<LinearLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView <TextView
android:layout_margin="10dp" android:layout_width="0dp"
android:textStyle="bold"
android:textSize="16sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:layout_weight="1"
android:text="@string/about_the_app" android:text="@string/source_code"
/> />
<TextView
android:layout_marginStart="5dp"
<!-- Code info --> android:id="@+id/source_code"
<LinearLayout android:layout_width="0dp"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:layout_weight="3"
<TextView android:autoLink="web"
android:layout_width="0dp" android:text="https://framagit.org/tom79/nitterizeme"
android:layout_height="wrap_content" tools:ignore="HardcodedText"
android:layout_weight="1" android:layout_marginLeft="5dp" />
android:text="@string/source_code"
/>
<TextView
android:layout_marginStart="5dp"
android:id="@+id/source_code"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:autoLink="web"
android:text="https://framagit.org/tom79/nitterizeme"
tools:ignore="HardcodedText"
android:layout_marginLeft="5dp" />
</LinearLayout>
<!-- Support info -->
<LinearLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/issue_tracker"
/>
<TextView
android:layout_marginStart="5dp"
android:id="@+id/issue_tracker"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:autoLink="web"
android:text="https://framagit.org/tom79/nitterizeme/issues"
tools:ignore="HardcodedText"
android:layout_marginLeft="5dp" />
</LinearLayout>
<!-- License info -->
<LinearLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/license"
/>
<TextView
android:layout_marginStart="5dp"
android:id="@+id/license"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="GPL3"
tools:ignore="HardcodedText"
android:layout_marginLeft="5dp" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</RelativeLayout>
<!-- Support info -->
<LinearLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/issue_tracker"
/>
<TextView
android:layout_marginStart="5dp"
android:id="@+id/issue_tracker"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:autoLink="web"
android:text="https://framagit.org/tom79/nitterizeme/issues"
tools:ignore="HardcodedText"
android:layout_marginLeft="5dp" />
</LinearLayout>
<!-- License info -->
<LinearLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/license"
/>
<TextView
android:layout_marginStart="5dp"
android:id="@+id/license"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="GPL3"
tools:ignore="HardcodedText"
android:layout_marginLeft="5dp" />
</LinearLayout>
</LinearLayout>
</ScrollView> </ScrollView>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal" android:layout_width="match_parent" android:orientation="horizontal" android:layout_width="match_parent"
android:id="@+id/main_container" android:id="@+id/main_container"
android:layout_marginStart="@dimen/fab_margin" android:layout_marginStart="@dimen/fab_margin"
@ -9,7 +10,8 @@
<ImageView <ImageView
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:id="@+id/app_icon"/> android:id="@+id/app_icon"
android:contentDescription="@string/icon_of_the_app" />
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1" android:layout_weight="1"
@ -30,5 +32,6 @@
<ImageView <ImageView
android:id="@+id/valid" android:id="@+id/valid"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp"/> android:layout_height="30dp"
tools:ignore="ContentDescription" />
</LinearLayout> </LinearLayout>

View File

@ -16,4 +16,8 @@
<string name="custom_invidious">Custom Invidious instance</string> <string name="custom_invidious">Custom Invidious instance</string>
<string name="no_apps">No applications by default</string> <string name="no_apps">No applications by default</string>
<string name="Donate">Donate</string> <string name="Donate">Donate</string>
<string name="warning">Warning</string>
<string name="error">Error</string>
<string name="valid">Valid</string>
<string name="icon_of_the_app">Icon of the app</string>
</resources> </resources>