1
0
mirror of https://framagit.org/tom79/nitterizeme synced 2025-02-09 08:18:41 +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>. */
public class AppInfo {
class AppInfo {
private String domain;
private android.content.pm.ApplicationInfo ApplicationInfo;
public String getDomain() {
String getDomain() {
return domain;
}
public void setDomain(String domain) {
void setDomain(String domain) {
this.domain = domain;
}
public android.content.pm.ApplicationInfo getApplicationInfo() {
android.content.pm.ApplicationInfo getApplicationInfo() {
return ApplicationInfo;
}
public void setApplicationInfo(android.content.pm.ApplicationInfo applicationInfo) {
void setApplicationInfo(android.content.pm.ApplicationInfo applicationInfo) {
ApplicationInfo = applicationInfo;
}
}

View File

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

View File

@ -21,6 +21,7 @@ import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -53,7 +54,7 @@ public class TransformActivity extends AppCompatActivity {
while (matcher.find()) {
final String youtubeId = matcher.group(3);
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";
} else {
newUrl = "https://" + invidiousHost + "/" + youtubeId + "&local=true";

View File

@ -23,212 +23,208 @@
android:scrollbars="none"
android:layout_margin="@dimen/fab_margin"
tools:context=".AboutActivity">
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_height="wrap_content"
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_height="wrap_content"
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" />
android:gravity="center"
android:text="@string/developer"
/>
<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" />
<!-- Developer info -->
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp">
<TextView
android:layout_margin="5dp"
android:textStyle="bold"
<LinearLayout
android:padding="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/developer"
/>
<!-- Developer info -->
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp">
android:orientation="horizontal"
android:baselineAligned="false">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:ignore="UseCompoundDrawables">
<TextView
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
android:padding="5dp"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_weight="3"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:baselineAligned="false">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:textSize="16sp"
android:id="@+id/developer_mastodon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:ignore="UseCompoundDrawables">
<TextView
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>
android:textStyle="bold"
android:text="\@fedilab@toot.fedilab.org"
tools:ignore="HardcodedText" />
<LinearLayout
android:layout_width="0dp"
android:layout_weight="3"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="horizontal">
<TextView
android:textSize="16sp"
android:id="@+id/developer_mastodon"
android:layout_width="match_parent"
android:id="@+id/framagit"
android:text="Framagit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="\@fedilab@toot.fedilab.org"
android:layout_weight="1"
tools:ignore="HardcodedText" />
<LinearLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent"
<TextView
android:textSize="16sp"
android:id="@+id/github"
android:text="Github"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:textSize="16sp"
android:id="@+id/framagit"
android:text="Framagit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
tools:ignore="HardcodedText" />
<TextView
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>
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>
</androidx.cardview.widget.CardView>
<!-- Idea from info -->
</LinearLayout>
</androidx.cardview.widget.CardView>
<!-- Idea from info -->
<Button
android:layout_marginTop="10dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Donate"
android:id="@+id/donate"
/>
<Button
android:layout_marginTop="10dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/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
android:layout_margin="10dp"
android:textStyle="bold"
android:textSize="16sp"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/about_the_app"
android:layout_weight="1"
android:text="@string/source_code"
/>
<!-- Code info -->
<LinearLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent"
<TextView
android:layout_marginStart="5dp"
android:id="@+id/source_code"
android:layout_width="0dp"
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/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>
android:layout_weight="3"
android:autoLink="web"
android:text="https://framagit.org/tom79/nitterizeme"
tools:ignore="HardcodedText"
android:layout_marginLeft="5dp" />
</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>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<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:id="@+id/main_container"
android:layout_marginStart="@dimen/fab_margin"
@ -9,7 +10,8 @@
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:id="@+id/app_icon"/>
android:id="@+id/app_icon"
android:contentDescription="@string/icon_of_the_app" />
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
@ -30,5 +32,6 @@
<ImageView
android:id="@+id/valid"
android:layout_width="30dp"
android:layout_height="30dp"/>
android:layout_height="30dp"
tools:ignore="ContentDescription" />
</LinearLayout>

View File

@ -16,4 +16,8 @@
<string name="custom_invidious">Custom Invidious instance</string>
<string name="no_apps">No applications by default</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>