Archived
Notifications are now automatically expanded, release number 1.2.5
This commit is contained in:
@@ -634,6 +634,13 @@ public class FragmentSettings extends Fragment {
|
||||
|
||||
break;
|
||||
}
|
||||
case "@NOTIFICATION": {
|
||||
edit.putString("time", "");
|
||||
edit.apply();
|
||||
Toast.makeText(getActivity(), "Dummy notification sent",
|
||||
Toast.LENGTH_LONG).show();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
Toast.makeText(getActivity(), getString(R.string.nothinghappened),
|
||||
Toast.LENGTH_LONG).show();
|
||||
|
||||
@@ -171,18 +171,14 @@ public class MainActivity extends AppCompatActivity {
|
||||
|
||||
AlertDialog.Builder alertDialog;
|
||||
View dialogView = LayoutInflater.from(context).inflate(R.layout.secret_dialog, null);
|
||||
TextView secretText = dialogView.findViewById(R.id.secrettext);
|
||||
if (prefs.getInt("themeInt", 0) == 1) {
|
||||
secretText.setTextColor(getResources().getColor(R.color.hintdark));
|
||||
alertDialog = new AlertDialog.Builder(context, R.style.AlertDialogCustomDark);
|
||||
} else {
|
||||
secretText.setTextColor(getResources().getColor(R.color.hint));
|
||||
alertDialog = new AlertDialog.Builder(context, R.style.AlertDialogCustomLight);
|
||||
}
|
||||
alertDialog.setTitle(R.string.chinaTitle);
|
||||
TextView dialogText = dialogView.findViewById(R.id.dialogtext);
|
||||
dialogText.setText(R.string.chinaDialog);
|
||||
secretText.setText(R.string.orbuy);
|
||||
// Button searchbtn = dialogView.findViewById(R.id.searchbtn);
|
||||
// searchbtn.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
|
||||
@@ -13,6 +13,8 @@ import android.graphics.Color;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.widget.RemoteViews;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.madapps.prefrences.EasyPrefrences;
|
||||
|
||||
@@ -261,13 +263,19 @@ public class ScheduledJobService extends JobService {
|
||||
openApp.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
PendingIntent openAppPending = PendingIntent.getActivity(mContext, 0, openApp, 0);
|
||||
|
||||
RemoteViews notificationLayout = new RemoteViews(getPackageName(), R.layout.notification);
|
||||
notificationLayout.setTextViewText(R.id.notification_title, getString(R.string.subst));
|
||||
notificationLayout.setTextViewText(R.id.notification_textview, notifText);
|
||||
|
||||
if (!notifText.isEmpty()) {
|
||||
Notification notification = null;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
notification = new NotificationCompat.Builder(mContext)
|
||||
.setContentTitle(getString(R.string.subst))
|
||||
.setStyle(new NotificationCompat.BigTextStyle()
|
||||
.bigText(notifText))
|
||||
// .setContentTitle(getString(R.string.subst))
|
||||
// .setStyle(new NotificationCompat.BigTextStyle()
|
||||
// .bigText(notifText))
|
||||
.setStyle(new NotificationCompat.DecoratedCustomViewStyle())
|
||||
.setCustomContentView(notificationLayout)
|
||||
.setSmallIcon(R.drawable.ic_avh)
|
||||
.setChannelId(channelId)
|
||||
.setContentIntent(openAppPending)
|
||||
@@ -275,9 +283,11 @@ public class ScheduledJobService extends JobService {
|
||||
.build();
|
||||
} else {
|
||||
notification = new NotificationCompat.Builder(mContext)
|
||||
.setContentTitle(getString(R.string.subst))
|
||||
.setStyle(new NotificationCompat.BigTextStyle()
|
||||
.bigText(notifText))
|
||||
// .setContentTitle(getString(R.string.subst))
|
||||
// .setStyle(new NotificationCompat.BigTextStyle()
|
||||
// .bigText(notifText))
|
||||
.setStyle(new NotificationCompat.DecoratedCustomViewStyle())
|
||||
.setCustomContentView(notificationLayout)
|
||||
.setSmallIcon(R.drawable.ic_avh)
|
||||
.setContentIntent(openAppPending)
|
||||
.setAutoCancel(true)
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/notification_title"
|
||||
style="@style/TextAppearance.Compat.Notification.Title"/>
|
||||
|
||||
<TextView
|
||||
android:layout_below="@+id/notification_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/notification_textview"
|
||||
style="@style/TextAppearance.Compat.Notification"/>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -21,18 +21,19 @@
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:paddingTop="8dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/secrettext"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/colorText"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:textSize="3dp"
|
||||
android:paddingTop="8dp"
|
||||
android:layout_marginBottom="24dp"/>
|
||||
|
||||
<!--<TextView-->
|
||||
<!--android:id="@+id/secrettext"-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:textColor="?attr/colorText"-->
|
||||
<!--android:paddingStart="24dp"-->
|
||||
<!--android:paddingEnd="24dp"-->
|
||||
<!--android:textSize="3dp"-->
|
||||
<!--android:layout_marginBottom="24dp"/>-->
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
Reference in New Issue
Block a user