Skip to content

Commit 7c17e35

Browse files
Merge pull request #93 from tygalive/master
Mark urls as not translatable, Add Package visibility filtering on Android 30+, Add RTL support for Action Items and Application Title and annotate functions for proper kotlin ingegration
2 parents ff319a9 + 09bc46f commit 7c17e35

File tree

21 files changed

+501
-360
lines changed

21 files changed

+501
-360
lines changed
0 Bytes
Binary file not shown.

app/src/main/java/com/vansuita/materialabout/sample/helper/SampleHelper.java

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import android.view.View;
66
import android.widget.FrameLayout;
77

8+
import androidx.annotation.NonNull;
9+
810
import com.vansuita.materialabout.builder.AboutBuilder;
911
import com.vansuita.materialabout.sample.R;
1012
import com.vansuita.materialabout.views.AboutView;
@@ -17,14 +19,16 @@ public class SampleHelper implements View.OnClickListener {
1719
private Activity activity;
1820
public static int theme = R.style.AppThemeDark;
1921

20-
private SampleHelper(Activity activity) {
22+
private SampleHelper(@NonNull Activity activity) {
2123
this.activity = activity;
2224
}
2325

24-
public static SampleHelper with(Activity activity) {
26+
@NonNull
27+
public static SampleHelper with(@NonNull Activity activity) {
2528
return new SampleHelper(activity);
2629
}
2730

31+
@NonNull
2832
public SampleHelper init() {
2933

3034
activity.findViewById(R.id.dark).setOnClickListener(this);
@@ -88,30 +92,23 @@ public void loadAbout() {
8892

8993

9094
@Override
91-
public void onClick(View view) {
92-
switch (view.getId()) {
93-
case R.id.dark:
94-
if (theme != R.style.AppThemeDark) {
95-
theme = R.style.AppThemeDark;
96-
activity.recreate();
97-
}
98-
break;
99-
case R.id.light:
100-
if (theme != R.style.AppThemeLight) {
101-
theme = R.style.AppThemeLight;
102-
activity.recreate();
103-
}
104-
break;
105-
106-
case R.id.custom:
107-
if (theme != R.style.AppThemeCustom) {
108-
theme = R.style.AppThemeCustom;
109-
activity.recreate();
110-
}
111-
break;
112-
113-
default:
114-
break;
95+
public void onClick(@NonNull View view) {
96+
if (view.getId() == R.id.dark && theme != R.style.AppThemeDark){
97+
theme = R.style.AppThemeDark;
98+
activity.recreate();
99+
return;
100+
}
101+
102+
if (view.getId() == R.id.light && theme != R.style.AppThemeLight){
103+
theme = R.style.AppThemeLight;
104+
activity.recreate();
105+
return;
115106
}
107+
108+
if (view.getId() == R.id.custom && theme != R.style.AppThemeCustom){
109+
theme = R.style.AppThemeCustom;
110+
activity.recreate();
111+
}
112+
116113
}
117114
}
Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,32 @@
1-
<manifest package="com.vansuita.materialabout" />
1+
<manifest package="com.vansuita.materialabout"
2+
xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<!--
5+
Package visibility filtering on Android 30+
6+
@link https://g.co/dev/packagevisibility
7+
@link https://developer.android.com/training/package-visibility/declaring#communicate-host-app
8+
-->
9+
<queries>
10+
<intent>
11+
<action android:name="android.intent.action.VIEW" />
12+
</intent>
13+
<intent>
14+
<action android:name="android.intent.action.INSERT" />
15+
</intent>
16+
<intent>
17+
<action android:name="android.intent.action.SENDTO" />
18+
</intent>
19+
<intent>
20+
<action android:name="android.intent.action.SEND" />
21+
</intent>
22+
23+
<package android:name="com.facebook.katana" />
24+
<package android:name="com.instagram.android" />
25+
<package android:name="com.twitter.android" />
26+
<package android:name="com.google.android.apps.plus" />
27+
<package android:name="com.linkedin.android" />
28+
<package android:name="com.skype.raider" />
29+
</queries>
30+
31+
</manifest>
232

0 commit comments

Comments
 (0)