Skip to content

Commit

Permalink
Merge pull request #93 from tygalive/master
Browse files Browse the repository at this point in the history
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
  • Loading branch information
richard-muvirimi authored Apr 28, 2021
2 parents ff319a9 + 09bc46f commit 7c17e35
Show file tree
Hide file tree
Showing 21 changed files with 501 additions and 360 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import android.view.View;
import android.widget.FrameLayout;

import androidx.annotation.NonNull;

import com.vansuita.materialabout.builder.AboutBuilder;
import com.vansuita.materialabout.sample.R;
import com.vansuita.materialabout.views.AboutView;
Expand All @@ -17,14 +19,16 @@ public class SampleHelper implements View.OnClickListener {
private Activity activity;
public static int theme = R.style.AppThemeDark;

private SampleHelper(Activity activity) {
private SampleHelper(@NonNull Activity activity) {
this.activity = activity;
}

public static SampleHelper with(Activity activity) {
@NonNull
public static SampleHelper with(@NonNull Activity activity) {
return new SampleHelper(activity);
}

@NonNull
public SampleHelper init() {

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


@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.dark:
if (theme != R.style.AppThemeDark) {
theme = R.style.AppThemeDark;
activity.recreate();
}
break;
case R.id.light:
if (theme != R.style.AppThemeLight) {
theme = R.style.AppThemeLight;
activity.recreate();
}
break;

case R.id.custom:
if (theme != R.style.AppThemeCustom) {
theme = R.style.AppThemeCustom;
activity.recreate();
}
break;

default:
break;
public void onClick(@NonNull View view) {
if (view.getId() == R.id.dark && theme != R.style.AppThemeDark){
theme = R.style.AppThemeDark;
activity.recreate();
return;
}

if (view.getId() == R.id.light && theme != R.style.AppThemeLight){
theme = R.style.AppThemeLight;
activity.recreate();
return;
}

if (view.getId() == R.id.custom && theme != R.style.AppThemeCustom){
theme = R.style.AppThemeCustom;
activity.recreate();
}

}
}
32 changes: 31 additions & 1 deletion library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
<manifest package="com.vansuita.materialabout" />
<manifest package="com.vansuita.materialabout"
xmlns:android="http://schemas.android.com/apk/res/android">

<!--
Package visibility filtering on Android 30+
@link https://g.co/dev/packagevisibility
@link https://developer.android.com/training/package-visibility/declaring#communicate-host-app
-->
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
</intent>
<intent>
<action android:name="android.intent.action.INSERT" />
</intent>
<intent>
<action android:name="android.intent.action.SENDTO" />
</intent>
<intent>
<action android:name="android.intent.action.SEND" />
</intent>

<package android:name="com.facebook.katana" />
<package android:name="com.instagram.android" />
<package android:name="com.twitter.android" />
<package android:name="com.google.android.apps.plus" />
<package android:name="com.linkedin.android" />
<package android:name="com.skype.raider" />
</queries>

</manifest>

Loading

0 comments on commit 7c17e35

Please sign in to comment.