version:2.0
fix: update:增加角标
This commit is contained in:
@@ -190,7 +190,7 @@ dependencies {
|
|||||||
implementation 'com.amap.api:location:5.1.0'
|
implementation 'com.amap.api:location:5.1.0'
|
||||||
//MMKV
|
//MMKV
|
||||||
implementation 'com.tencent:mmkv-static:1.2.12'
|
implementation 'com.tencent:mmkv-static:1.2.12'
|
||||||
implementation 'com.tencent.tpns:tpns:1.3.3.3-release'
|
implementation 'com.tencent.tpns:tpns:1.3.4.1-release'
|
||||||
//状态栏透明
|
//状态栏透明
|
||||||
implementation 'com.gitee.zackratos:UltimateBarX:0.8.0'
|
implementation 'com.gitee.zackratos:UltimateBarX:0.8.0'
|
||||||
//指示器
|
//指示器
|
||||||
|
|||||||
@@ -144,6 +144,15 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
|
<service
|
||||||
|
android:name=".service.NotificationService"
|
||||||
|
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.service.notification.NotificationListenerService" />
|
||||||
|
</intent-filter>
|
||||||
|
</service>
|
||||||
|
|
||||||
|
|
||||||
<!-- 高德地图 -->
|
<!-- 高德地图 -->
|
||||||
<!-- 设置key -->
|
<!-- 设置key -->
|
||||||
<meta-data
|
<meta-data
|
||||||
@@ -265,7 +274,6 @@
|
|||||||
<service android:exported="false"
|
<service android:exported="false"
|
||||||
android:process=":xg_vip_service"
|
android:process=":xg_vip_service"
|
||||||
android:name="com.tencent.tpns.mqttchannel.services.MqttService" />
|
android:name="com.tencent.tpns.mqttchannel.services.MqttService" />
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:name="com.tencent.tpns.baseapi.base.SettingsContentProvider"
|
android:name="com.tencent.tpns.baseapi.base.SettingsContentProvider"
|
||||||
|
|||||||
@@ -1,15 +1,18 @@
|
|||||||
package com.uiui.aios.activity.main;
|
package com.uiui.aios.activity.main;
|
||||||
|
|
||||||
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.ServiceConnection;
|
import android.content.ServiceConnection;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
@@ -32,8 +35,10 @@ import com.uiui.aios.fragment.AppListFragment;
|
|||||||
import com.uiui.aios.fragment.BaseFragmentPagerAdapter;
|
import com.uiui.aios.fragment.BaseFragmentPagerAdapter;
|
||||||
import com.uiui.aios.fragment.CustomFragment;
|
import com.uiui.aios.fragment.CustomFragment;
|
||||||
import com.uiui.aios.fragment.SecondFragment;
|
import com.uiui.aios.fragment.SecondFragment;
|
||||||
|
import com.uiui.aios.service.NotificationService;
|
||||||
import com.uiui.aios.utils.ApkUtils;
|
import com.uiui.aios.utils.ApkUtils;
|
||||||
import com.uiui.aios.utils.AppUsedTimeUtils;
|
import com.uiui.aios.utils.AppUsedTimeUtils;
|
||||||
|
import com.uiui.aios.utils.ToastUtil;
|
||||||
import com.uiui.aios.view.ScaleCircleNavigator;
|
import com.uiui.aios.view.ScaleCircleNavigator;
|
||||||
|
|
||||||
import net.lucode.hackware.magicindicator.MagicIndicator;
|
import net.lucode.hackware.magicindicator.MagicIndicator;
|
||||||
@@ -70,6 +75,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
|||||||
@Override
|
@Override
|
||||||
public void initView() {
|
public void initView() {
|
||||||
ButterKnife.bind(this);
|
ButterKnife.bind(this);
|
||||||
|
toggleNotificationListenerService(this);
|
||||||
mMainPresenter = new MainPresenter(this);
|
mMainPresenter = new MainPresenter(this);
|
||||||
mMainPresenter.attachView(this);
|
mMainPresenter.attachView(this);
|
||||||
mMainPresenter.setLifecycle(lifecycleSubject);
|
mMainPresenter.setLifecycle(lifecycleSubject);
|
||||||
@@ -158,6 +164,16 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void toggleNotificationListenerService(Context context) {
|
||||||
|
Log.e(TAG, "toggleNotificationListenerService");
|
||||||
|
PackageManager pm = context.getPackageManager();
|
||||||
|
pm.setComponentEnabledSetting(new ComponentName(context, NotificationService.class),
|
||||||
|
PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
|
||||||
|
|
||||||
|
pm.setComponentEnabledSetting(new ComponentName(context, NotificationService.class),
|
||||||
|
PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
|
||||||
|
}
|
||||||
|
|
||||||
private void getAlarmData() {
|
private void getAlarmData() {
|
||||||
if (mIAlarmAidlInterface == null) {
|
if (mIAlarmAidlInterface == null) {
|
||||||
bindAlarmService();
|
bindAlarmService();
|
||||||
@@ -251,9 +267,57 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
if (!isNotificationListenersEnabled()) {
|
||||||
|
ToastUtil.show("请授予\"" + getString(R.string.app_name) + "\"使用通知权");
|
||||||
|
gotoNotificationAccessSetting(this);
|
||||||
|
}
|
||||||
mMainPresenter.sendRunningInfo();
|
mMainPresenter.sendRunningInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
|
||||||
|
|
||||||
|
private boolean isNotificationListenersEnabled() {
|
||||||
|
String pkgName = getPackageName();
|
||||||
|
final String flat = Settings.Secure.getString(getContentResolver(), ENABLED_NOTIFICATION_LISTENERS);
|
||||||
|
if (!TextUtils.isEmpty(flat)) {
|
||||||
|
final String[] names = flat.split(":");
|
||||||
|
for (int i = 0; i < names.length; i++) {
|
||||||
|
final ComponentName cn = ComponentName.unflattenFromString(names[i]);
|
||||||
|
if (cn != null) {
|
||||||
|
if (TextUtils.equals(pkgName, cn.getPackageName())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean gotoNotificationAccessSetting(Context context) {
|
||||||
|
try {
|
||||||
|
Intent intent = new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
context.startActivity(intent);
|
||||||
|
return true;
|
||||||
|
|
||||||
|
} catch (ActivityNotFoundException e) {//普通情况下找不到的时候需要再特殊处理找一次
|
||||||
|
try {
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
ComponentName cn = new ComponentName("com.android.settings", "com.android.settings.Settings$NotificationAccessSettingsActivity");
|
||||||
|
intent.setComponent(cn);
|
||||||
|
intent.putExtra(":settings:show_fragment", "NotificationAccessSettings");
|
||||||
|
context.startActivity(intent);
|
||||||
|
return true;
|
||||||
|
} catch (Exception e1) {
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
ToastUtil.show("对不起,您的手机暂不支持");
|
||||||
|
e.printStackTrace();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onRestart() {
|
protected void onRestart() {
|
||||||
super.onRestart();
|
super.onRestart();
|
||||||
|
|||||||
@@ -9,11 +9,13 @@ import android.widget.LinearLayout;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
|
||||||
import com.uiui.aios.R;
|
import com.uiui.aios.R;
|
||||||
import com.uiui.aios.bean.AppListInfo;
|
import com.uiui.aios.bean.AppListInfo;
|
||||||
|
import com.uiui.aios.service.NotificationService;
|
||||||
import com.uiui.aios.utils.ApkUtils;
|
import com.uiui.aios.utils.ApkUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -46,14 +48,25 @@ public class APPListAdapter extends RecyclerView.Adapter<APPListAdapter.holder>
|
|||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull holder holder, int position) {
|
public void onBindViewHolder(@NonNull holder holder, int position) {
|
||||||
final AppListInfo info = mAppListInfos.get(position);
|
final AppListInfo info = mAppListInfos.get(position);
|
||||||
|
String pkg = info.getPackageName();
|
||||||
holder.icon.setImageBitmap(info.getIcon());
|
holder.icon.setImageBitmap(info.getIcon());
|
||||||
holder.appname.setText(info.getAppName());
|
holder.appname.setText(info.getAppName());
|
||||||
holder.root.setOnClickListener(new View.OnClickListener() {
|
holder.root.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
ApkUtils.openPackage(mContext, info.getPackageName());
|
ApkUtils.openPackage(mContext, pkg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
int size = NotificationService.getNotificationLength(pkg);
|
||||||
|
if (size == 0) {
|
||||||
|
holder.bg.setVisibility(View.GONE);
|
||||||
|
} else if (size < 99) {
|
||||||
|
holder.bg.setVisibility(View.VISIBLE);
|
||||||
|
holder.bg.setText(String.valueOf(size));
|
||||||
|
} else {
|
||||||
|
holder.bg.setVisibility(View.VISIBLE);
|
||||||
|
holder.bg.setText("99+");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -64,12 +77,14 @@ public class APPListAdapter extends RecyclerView.Adapter<APPListAdapter.holder>
|
|||||||
class holder extends RecyclerView.ViewHolder {
|
class holder extends RecyclerView.ViewHolder {
|
||||||
private ImageView icon;
|
private ImageView icon;
|
||||||
private TextView appname;
|
private TextView appname;
|
||||||
private LinearLayout root;
|
private TextView bg;
|
||||||
|
private ConstraintLayout root;
|
||||||
|
|
||||||
public holder(@NonNull View itemView) {
|
public holder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
icon = itemView.findViewById(R.id.iv_icon);
|
icon = itemView.findViewById(R.id.iv_icon);
|
||||||
appname = itemView.findViewById(R.id.tv_appname);
|
appname = itemView.findViewById(R.id.tv_appname);
|
||||||
|
bg = itemView.findViewById(R.id.bg);
|
||||||
root = itemView.findViewById(R.id.root);
|
root = itemView.findViewById(R.id.root);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.content.res.Configuration;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -21,6 +22,7 @@ import com.uiui.aios.R;
|
|||||||
import com.uiui.aios.bean.BaseResponse;
|
import com.uiui.aios.bean.BaseResponse;
|
||||||
import com.uiui.aios.bean.DesktopIcon;
|
import com.uiui.aios.bean.DesktopIcon;
|
||||||
import com.uiui.aios.network.NetInterfaceManager;
|
import com.uiui.aios.network.NetInterfaceManager;
|
||||||
|
import com.uiui.aios.service.NotificationService;
|
||||||
import com.uiui.aios.utils.ApkUtils;
|
import com.uiui.aios.utils.ApkUtils;
|
||||||
import com.uiui.aios.utils.BitmapUtils;
|
import com.uiui.aios.utils.BitmapUtils;
|
||||||
import com.uiui.aios.utils.IconUtils;
|
import com.uiui.aios.utils.IconUtils;
|
||||||
@@ -115,17 +117,28 @@ public class AppListFragment extends Fragment {
|
|||||||
null);
|
null);
|
||||||
ImageView iv = view.findViewById(R.id.iv);
|
ImageView iv = view.findViewById(R.id.iv);
|
||||||
TextView tv = view.findViewById(R.id.tv);
|
TextView tv = view.findViewById(R.id.tv);
|
||||||
LinearLayout linearLayout = view.findViewById(R.id.btn_booktag);
|
TextView bg = view.findViewById(R.id.bg);
|
||||||
|
ConstraintLayout constraintLayout = view.findViewById(R.id.btn_booktag);
|
||||||
DesktopIcon desktopIcon = mDesktopIcons.get(index);
|
DesktopIcon desktopIcon = mDesktopIcons.get(index);
|
||||||
|
|
||||||
if (desktopIcon != null) {
|
if (desktopIcon != null) {
|
||||||
Log.e(TAG, "getView: " + desktopIcon.getPackageName());
|
String pkg =desktopIcon.getPackageName();
|
||||||
int i = IconUtils.appClassNameList.indexOf(desktopIcon.getPackageName());
|
Log.e(TAG, "getView: " + pkg);
|
||||||
|
int i = IconUtils.appClassNameList.indexOf(pkg);
|
||||||
if (i != -1) {
|
if (i != -1) {
|
||||||
String val = IconUtils.appIconList.get(i);
|
String val = IconUtils.appIconList.get(i);
|
||||||
int resID = getActivity().getResources().getIdentifier(val, "drawable", "com.uiui.aios");
|
int resID = getActivity().getResources().getIdentifier(val, "drawable", "com.uiui.aios");
|
||||||
|
int size = NotificationService.getNotificationLength(pkg);
|
||||||
|
if (size == 0) {
|
||||||
|
bg.setVisibility(View.GONE);
|
||||||
|
} else if (size < 99) {
|
||||||
|
bg.setVisibility(View.VISIBLE);
|
||||||
|
bg.setText(String.valueOf(size));
|
||||||
|
} else {
|
||||||
|
bg.setVisibility(View.VISIBLE);
|
||||||
|
bg.setText("99+");
|
||||||
|
}
|
||||||
if (resID == 0) {
|
if (resID == 0) {
|
||||||
Log.e(TAG, "getView: not found src : " + desktopIcon.getPackageName());
|
Log.e(TAG, "getView: not found src : " + pkg);
|
||||||
iv.setImageDrawable(desktopIcon.getIcon());
|
iv.setImageDrawable(desktopIcon.getIcon());
|
||||||
} else {
|
} else {
|
||||||
iv.setImageDrawable(getActivity().getResources().getDrawable(resID));
|
iv.setImageDrawable(getActivity().getResources().getDrawable(resID));
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package com.uiui.aios.service;
|
||||||
|
|
||||||
|
import android.service.notification.NotificationListenerService;
|
||||||
|
import android.service.notification.StatusBarNotification;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TT
|
||||||
|
*/
|
||||||
|
public class NotificationService extends NotificationListenerService {
|
||||||
|
private static final String TAG = NotificationService.class.getSimpleName();
|
||||||
|
|
||||||
|
private static HashMap<String, List<StatusBarNotification>> notificationMap = new HashMap<String, List<StatusBarNotification>>();
|
||||||
|
private static NotificationListener mListener;
|
||||||
|
|
||||||
|
private void updateNotification() {
|
||||||
|
notificationMap.clear();
|
||||||
|
StatusBarNotification[] statusBarNotifications = getActiveNotifications();
|
||||||
|
for (StatusBarNotification sbn : statusBarNotifications) {
|
||||||
|
String pkg = sbn.getPackageName();
|
||||||
|
Log.e(TAG, "onListenerConnected: " + pkg);
|
||||||
|
if (notificationMap.get(pkg) == null) {
|
||||||
|
notificationMap.put(pkg, new ArrayList<>());
|
||||||
|
notificationMap.get(pkg).add(sbn);
|
||||||
|
} else {
|
||||||
|
notificationMap.get(pkg).add(sbn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Log.e(TAG, "onListenerConnected: " + notificationMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getNotificationLength(String pkg) {
|
||||||
|
if (notificationMap.get(pkg) == null) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return notificationMap.get(pkg).size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setListener(NotificationListener listener) {
|
||||||
|
mListener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface NotificationListener {
|
||||||
|
void onListenerConnected();
|
||||||
|
|
||||||
|
void onNotificationPosted(StatusBarNotification sbn);
|
||||||
|
|
||||||
|
void onNotificationRemoved(StatusBarNotification sbn);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onListenerConnected() {
|
||||||
|
super.onListenerConnected();
|
||||||
|
Log.e(TAG, "onListenerConnected: " + getActiveNotifications().length);
|
||||||
|
updateNotification();
|
||||||
|
if (mListener != null)
|
||||||
|
mListener.onListenerConnected();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNotificationPosted(StatusBarNotification sbn) {
|
||||||
|
super.onNotificationPosted(sbn);
|
||||||
|
Log.e(TAG, "onNotificationPosted: " + getActiveNotifications().length);
|
||||||
|
updateNotification();
|
||||||
|
if (mListener != null)
|
||||||
|
mListener.onNotificationPosted(sbn);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNotificationRemoved(StatusBarNotification sbn) {
|
||||||
|
super.onNotificationRemoved(sbn);
|
||||||
|
Log.e(TAG, "onNotificationRemoved: " + getActiveNotifications().length);
|
||||||
|
updateNotification();
|
||||||
|
if (mListener != null)
|
||||||
|
mListener.onNotificationRemoved(sbn);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
13
app/src/main/res/drawable/badge_bg.xml
Normal file
13
app/src/main/res/drawable/badge_bg.xml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- 内部颜色 -->
|
||||||
|
<solid
|
||||||
|
android:color="@color/red" />
|
||||||
|
<!-- 圆角的幅度 -->
|
||||||
|
<corners
|
||||||
|
android:topLeftRadius="30dp"
|
||||||
|
android:topRightRadius="30dp"
|
||||||
|
android:bottomLeftRadius="30dp"
|
||||||
|
android:bottomRightRadius="30dp" />
|
||||||
|
</shape>
|
||||||
@@ -1,28 +1,62 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/root"
|
android:id="@+id/root"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/iv_icon"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="80dp"
|
|
||||||
android:layout_height="80dp"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
app:srcCompat="@mipmap/ic_launcher" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_appname"
|
|
||||||
android:layout_width="90dp"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:gravity="center_horizontal"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:singleLine="true"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:textColor="@color/white"
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
android:textSize="17sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
<ImageView
|
||||||
|
android:id="@+id/iv_icon"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="80dp"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:srcCompat="@mipmap/ic_launcher" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/bg"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginStart="60dp"
|
||||||
|
android:layout_marginBottom="60dp"
|
||||||
|
android:background="@drawable/badge_bg"
|
||||||
|
android:gravity="center"
|
||||||
|
android:minWidth="30dp"
|
||||||
|
android:text="1"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/iv_icon"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/iv_icon" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_appname"
|
||||||
|
android:layout_width="90dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="17sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/iv_icon"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/iv_icon"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/iv_icon" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -1,28 +1,62 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/root"
|
android:id="@+id/root"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/iv_icon"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="100dp"
|
|
||||||
android:layout_height="100dp"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
app:srcCompat="@mipmap/ic_launcher" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_appname"
|
|
||||||
android:layout_width="90dp"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:gravity="center_horizontal"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:singleLine="true"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:textColor="@color/white"
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
android:textSize="17sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
<ImageView
|
||||||
|
android:id="@+id/iv_icon"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="80dp"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:srcCompat="@mipmap/ic_launcher" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/bg"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginStart="60dp"
|
||||||
|
android:layout_marginBottom="60dp"
|
||||||
|
android:background="@drawable/badge_bg"
|
||||||
|
android:gravity="center"
|
||||||
|
android:minWidth="30dp"
|
||||||
|
android:text="1"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/iv_icon"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/iv_icon" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_appname"
|
||||||
|
android:layout_width="90dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="17sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/iv_icon"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/iv_icon"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/iv_icon" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -1,25 +1,57 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/btn_booktag"
|
android:id="@+id/btn_booktag"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/actions_item_selector"
|
android:background="@drawable/actions_item_selector"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/iv"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="80dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="80dp"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:adjustViewBounds="true"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:scaleType="fitCenter" />
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/tv"
|
android:id="@+id/iv"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="80dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="80dp"
|
||||||
android:layout_marginTop="@dimen/actions_item_drawablePaddding"
|
android:adjustViewBounds="true"
|
||||||
android:textColor="@color/white"
|
android:scaleType="fitCenter"
|
||||||
android:textSize="@dimen/actions_item_font" />
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
</LinearLayout>
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/bg"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginStart="60dp"
|
||||||
|
android:layout_marginBottom="60dp"
|
||||||
|
android:background="@drawable/badge_bg"
|
||||||
|
android:gravity="center"
|
||||||
|
android:minWidth="30dp"
|
||||||
|
android:text="1"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="15sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/iv"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/iv" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/actions_item_font"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/iv"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/iv"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/iv" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
Reference in New Issue
Block a user