替换分享框按钮资源

This commit is contained in:
tongchenfei
2020-05-27 11:04:09 +08:00
parent f35e1eb301
commit 6993ee4b09
23 changed files with 222 additions and 111 deletions

View File

@@ -9,6 +9,7 @@ import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
@@ -44,17 +45,17 @@ public class LaucherShareDialog implements View.OnClickListener {
private boolean isShown = false;
private TextView tvBlock;
private TextView tvTrafficCheck;
private TextView tvClosure;
private TextView tvNeedHelp;
private ImageView ivBlock;
private ImageView ivTrafficCheck;
private ImageView ivClosure;
private ImageView ivNeedHelp;
private TextView tvAccident;
private TextView tvRealTimeTraffic;
private TextView tvStagnantWater;
private TextView tvRoadIcy;
private TextView tvDenseFog;
private TextView tvConstruction;
private ImageView ivAccident;
private ImageView ivRealTimeTraffic;
private ImageView ivStagnantWater;
private ImageView ivRoadIcy;
private ImageView ivDenseFog;
private ImageView ivConstruction;
private Context mContext;
private IMogoAnalytics mAnalytics;
@@ -82,39 +83,39 @@ public class LaucherShareDialog implements View.OnClickListener {
});
tvBlock = body.findViewById(R.id.tvBlock);
tvTrafficCheck = body.findViewById(R.id.tvTrafficCheck);
tvClosure = body.findViewById(R.id.tvClosure);
tvNeedHelp = body.findViewById(R.id.tvSeekHelp);
ivBlock = body.findViewById(R.id.ivBlock);
ivTrafficCheck = body.findViewById(R.id.ivTrafficCheck);
ivClosure = body.findViewById(R.id.ivClosure);
ivNeedHelp = body.findViewById(R.id.ivSeekHelp);
tvAccident = body.findViewById(R.id.tvAccident);
tvRealTimeTraffic = body.findViewById(R.id.tvRealTimeTraffic);
tvStagnantWater = body.findViewById(R.id.tvStagnantWater);
tvRoadIcy = body.findViewById(R.id.tvRoadIcy);
tvDenseFog = body.findViewById(R.id.tvDenseFog);
tvConstruction = body.findViewById(R.id.tvConstruction);
ivAccident = body.findViewById(R.id.ivAccident);
ivRealTimeTraffic = body.findViewById(R.id.ivRealTimeTraffic);
ivStagnantWater = body.findViewById(R.id.ivStagnantWater);
ivRoadIcy = body.findViewById(R.id.ivRoadIcy);
ivDenseFog = body.findViewById(R.id.ivDenseFog);
ivConstruction = body.findViewById(R.id.ivConstruction);
}
private void initListener() {
tvBlock.setOnClickListener(this);
tvNeedHelp.setOnClickListener(this);
tvTrafficCheck.setOnClickListener(this);
tvClosure.setOnClickListener(this);
ivBlock.setOnClickListener(this);
ivNeedHelp.setOnClickListener(this);
ivTrafficCheck.setOnClickListener(this);
ivClosure.setOnClickListener(this);
tvAccident.setOnClickListener(this);
tvRealTimeTraffic.setOnClickListener(this);
tvStagnantWater.setOnClickListener(this);
tvRoadIcy.setOnClickListener(this);
tvDenseFog.setOnClickListener(this);
tvConstruction.setOnClickListener(this);
ivAccident.setOnClickListener(this);
ivRealTimeTraffic.setOnClickListener(this);
ivStagnantWater.setOnClickListener(this);
ivRoadIcy.setOnClickListener(this);
ivDenseFog.setOnClickListener(this);
ivConstruction.setOnClickListener(this);
}
@Override
public void onClick(View view) {
int id = view.getId();
Logger.d(TAG, "onClick: " + id);
if (id == R.id.tvBlock) {
if (id == R.id.ivBlock) {
//拥堵
traceTanluData("1");
sendShareReceiver(ShareConstants.TYPE_BLOCK);
@@ -128,43 +129,43 @@ public class LaucherShareDialog implements View.OnClickListener {
mContext.startActivity(intent);
traceTypeData("2");
dismiss();
} else if (id == R.id.tvTrafficCheck) {
} else if (id == R.id.ivTrafficCheck) {
//交通检查
traceData("1");
sendShareReceiver(ShareConstants.TYPE_TRAFFIC_CHECK);
traceTypeData("3");
dismiss();
} else if (id == R.id.tvClosure) {
} else if (id == R.id.ivClosure) {
//封路
traceData("1");
sendShareReceiver(ShareConstants.TYPE_CLOSURE);
traceTypeData("4");
dismiss();
} else if (id == R.id.tvSeekHelp) {
} else if (id == R.id.ivSeekHelp) {
// 故障求助
SeekHelpManager.INSTANCE.seekHelp(mContext,seekListener,true);
dismiss();
} else if (id == R.id.tvAccident) {
} else if (id == R.id.ivAccident) {
// 事故
sendShareReceiver(ShareConstants.TYPE_ACCIDENT);
dismiss();
} else if (id == R.id.tvConstruction) {
} else if (id == R.id.ivConstruction) {
// 道路施工
sendShareReceiver(ShareConstants.TYPE_ROAD_CONSTRUCTION);
dismiss();
} else if (id == R.id.tvRealTimeTraffic) {
} else if (id == R.id.ivRealTimeTraffic) {
// 实时路况
sendShareReceiver(ShareConstants.TYPE_REAL_TIME_TRAFFIC);
dismiss();
} else if (id == R.id.tvStagnantWater) {
} else if (id == R.id.ivStagnantWater) {
// 道路积水
sendShareReceiver(ShareConstants.TYPE_STAGNANT_WATER);
dismiss();
} else if (id == R.id.tvRoadIcy) {
} else if (id == R.id.ivRoadIcy) {
// 道路结冰
sendShareReceiver(ShareConstants.TYPE_ROAD_ICY);
dismiss();
} else if (id == R.id.tvDenseFog) {
} else if (id == R.id.ivDenseFog) {
// 浓雾
sendShareReceiver(ShareConstants.TYPE_DENSE_FOG);
dismiss();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 967 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="oval">
<size android:width="@dimen/dp_160" android:height="@dimen/dp_160" />
<gradient android:startColor="#474C6F" android:endColor="#353956" />
</shape>
</item>
</selector>

View File

@@ -31,138 +31,239 @@
app:layout_constraintStart_toStartOf="@+id/vBg"
app:layout_constraintTop_toTopOf="@+id/vBg" />
<ImageView
android:id="@+id/ivBlock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_78"
android:background="@drawable/module_share_btn_bg"
android:scaleType="center"
android:src="@drawable/share_block_up"
app:layout_constraintLeft_toLeftOf="@+id/tvBlock"
app:layout_constraintRight_toRightOf="@+id/tvBlock"
app:layout_constraintTop_toBottomOf="@+id/btn_share_title" />
<TextView
android:id="@+id/tvBlock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/share_block_up"
android:text="拥堵"
android:textSize="@dimen/dp_32"
android:textColor="#fff"
app:layout_constraintHorizontal_chainStyle="spread_inside"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@+id/btn_share_title"
app:layout_constraintRight_toLeftOf="@+id/tvTrafficCheck"
app:layout_constraintLeft_toLeftOf="@+id/vBg"
android:layout_marginStart="@dimen/dp_116"
android:layout_marginTop="@dimen/dp_78"
android:drawablePadding="@dimen/dp_30" />
android:layout_marginTop="@dimen/dp_30"
android:text="拥堵"
android:textColor="#fff"
android:textSize="@dimen/dp_32"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintLeft_toLeftOf="@+id/vBg"
app:layout_constraintRight_toLeftOf="@+id/tvTrafficCheck"
app:layout_constraintTop_toBottomOf="@+id/ivBlock" />
<ImageView
android:id="@+id/ivTrafficCheck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_30"
android:background="@drawable/module_share_btn_bg"
android:scaleType="center"
android:src="@drawable/share_traffic_check"
app:layout_constraintBottom_toTopOf="@id/tvTrafficCheck"
app:layout_constraintLeft_toLeftOf="@+id/tvTrafficCheck"
app:layout_constraintRight_toRightOf="@+id/tvTrafficCheck" />
<TextView
android:id="@+id/tvTrafficCheck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/share_traffic_check"
android:text="交通检查"
android:textSize="@dimen/dp_32"
android:textColor="#fff"
android:gravity="center"
app:layout_constraintTop_toTopOf="@+id/tvBlock"
android:text="交通检查"
android:textColor="#fff"
android:textSize="@dimen/dp_32"
app:layout_constraintLeft_toRightOf="@id/tvBlock"
app:layout_constraintRight_toLeftOf="@+id/tvClosure"
android:drawablePadding="@dimen/dp_30" />
app:layout_constraintTop_toTopOf="@+id/tvBlock" />
<ImageView
android:id="@+id/ivClosure"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_30"
android:background="@drawable/module_share_btn_bg"
android:scaleType="center"
android:src="@drawable/share_road_closure"
app:layout_constraintBottom_toTopOf="@id/tvClosure"
app:layout_constraintLeft_toLeftOf="@+id/tvClosure"
app:layout_constraintRight_toRightOf="@+id/tvClosure" />
<TextView
android:id="@+id/tvClosure"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/share_road_closure"
android:gravity="center"
android:text="封路"
android:textColor="#fff"
android:textSize="@dimen/dp_32"
app:layout_constraintTop_toTopOf="@+id/tvBlock"
app:layout_constraintLeft_toRightOf="@+id/tvTrafficCheck"
app:layout_constraintRight_toLeftOf="@+id/tvAccident"
android:textColor="#fff"
android:gravity="center"
android:drawablePadding="@dimen/dp_30" />
app:layout_constraintTop_toTopOf="@+id/tvBlock" />
<ImageView
android:id="@+id/ivAccident"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_30"
android:background="@drawable/module_share_btn_bg"
android:scaleType="center"
android:src="@drawable/share_accident"
app:layout_constraintBottom_toTopOf="@id/tvAccident"
app:layout_constraintLeft_toLeftOf="@+id/tvAccident"
app:layout_constraintRight_toRightOf="@+id/tvAccident" />
<TextView
android:id="@+id/tvAccident"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/share_accident"
android:gravity="center"
android:text="事故"
android:textColor="#fff"
android:textSize="@dimen/dp_32"
app:layout_constraintTop_toTopOf="@+id/tvBlock"
app:layout_constraintLeft_toRightOf="@+id/tvClosure"
app:layout_constraintRight_toLeftOf="@+id/tvConstruction"
android:textColor="#fff"
android:gravity="center"
android:drawablePadding="@dimen/dp_30" />
app:layout_constraintTop_toTopOf="@+id/tvBlock" />
<ImageView
android:id="@+id/ivConstruction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_30"
android:background="@drawable/module_share_btn_bg"
android:scaleType="center"
android:src="@drawable/share_road_construction"
app:layout_constraintBottom_toTopOf="@id/tvConstruction"
app:layout_constraintLeft_toLeftOf="@+id/tvConstruction"
app:layout_constraintRight_toRightOf="@+id/tvConstruction" />
<TextView
android:id="@+id/tvConstruction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/share_road_construction"
android:layout_marginEnd="@dimen/dp_116"
android:gravity="center"
android:text="施工"
android:textColor="#fff"
android:textSize="@dimen/dp_32"
app:layout_constraintTop_toTopOf="@+id/tvBlock"
app:layout_constraintLeft_toRightOf="@+id/tvAccident"
app:layout_constraintRight_toRightOf="@+id/vBg"
android:layout_marginEnd="@dimen/dp_116"
android:textColor="#fff"
android:gravity="center"
android:drawablePadding="@dimen/dp_30" />
app:layout_constraintTop_toTopOf="@+id/tvBlock" />
<ImageView
android:id="@+id/ivRealTimeTraffic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_62"
android:background="@drawable/module_share_btn_bg"
android:scaleType="center"
android:src="@drawable/share_real_time_traffic"
app:layout_constraintLeft_toLeftOf="@+id/tvBlock"
app:layout_constraintRight_toRightOf="@+id/tvBlock"
app:layout_constraintTop_toBottomOf="@+id/tvBlock" />
<TextView
android:id="@+id/tvRealTimeTraffic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/share_real_time_traffic"
android:text="实时路况"
android:textSize="@dimen/dp_32"
android:textColor="#fff"
android:layout_marginTop="@dimen/dp_30"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@+id/tvBlock"
app:layout_constraintLeft_toLeftOf="@+id/tvBlock"
android:layout_marginTop="@dimen/dp_62"
android:drawablePadding="@dimen/dp_30" />
android:text="实时路况"
android:textColor="#fff"
android:textSize="@dimen/dp_32"
app:layout_constraintLeft_toLeftOf="@+id/ivRealTimeTraffic"
app:layout_constraintRight_toRightOf="@+id/ivRealTimeTraffic"
app:layout_constraintTop_toBottomOf="@+id/ivRealTimeTraffic" />
<ImageView
android:id="@+id/ivSeekHelp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_30"
android:background="@drawable/module_share_btn_bg"
android:scaleType="center"
android:src="@drawable/share_seek_help"
app:layout_constraintLeft_toLeftOf="@+id/tvSeekHelp"
app:layout_constraintRight_toRightOf="@+id/tvSeekHelp"
app:layout_constraintBottom_toTopOf="@+id/tvSeekHelp"/>
<TextView
android:id="@+id/tvSeekHelp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/share_seek_help"
android:text="故障求助"
android:textSize="@dimen/dp_32"
android:textColor="#fff"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@+id/tvTrafficCheck"
android:text="故障求助"
android:textColor="#fff"
android:textSize="@dimen/dp_32"
app:layout_constraintLeft_toLeftOf="@+id/tvTrafficCheck"
android:layout_marginTop="@dimen/dp_62"
android:drawablePadding="@dimen/dp_30" />
app:layout_constraintRight_toRightOf="@+id/tvTrafficCheck"
app:layout_constraintTop_toTopOf="@id/tvRealTimeTraffic"/>
<ImageView
android:id="@+id/ivStagnantWater"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_30"
android:background="@drawable/module_share_btn_bg"
android:scaleType="center"
android:src="@drawable/share_stagnant_water"
app:layout_constraintLeft_toLeftOf="@+id/tvStagnantWater"
app:layout_constraintRight_toRightOf="@+id/tvStagnantWater"
app:layout_constraintBottom_toTopOf="@+id/tvStagnantWater"/>
<TextView
android:id="@+id/tvStagnantWater"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/share_stagnant_water"
android:text="道路积水"
android:textSize="@dimen/dp_32"
android:textColor="#fff"
android:gravity="center"
app:layout_constraintTop_toBottomOf="@+id/tvClosure"
android:text="道路积水"
android:textColor="#fff"
android:textSize="@dimen/dp_32"
app:layout_constraintLeft_toLeftOf="@+id/tvClosure"
android:layout_marginTop="@dimen/dp_62"
android:drawablePadding="@dimen/dp_30" />
app:layout_constraintRight_toRightOf="@+id/tvClosure"
app:layout_constraintTop_toTopOf="@+id/tvSeekHelp"/>
<ImageView
android:id="@+id/ivRoadIcy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_30"
android:background="@drawable/module_share_btn_bg"
android:scaleType="center"
android:src="@drawable/share_road_icy"
app:layout_constraintLeft_toLeftOf="@+id/tvRoadIcy"
app:layout_constraintRight_toRightOf="@+id/tvRoadIcy"
app:layout_constraintBottom_toTopOf="@+id/tvRoadIcy"/>
<TextView
android:id="@+id/tvRoadIcy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/share_road_icy"
android:text="道路积冰"
android:textSize="@dimen/dp_32"
android:textColor="#fff"
app:layout_constraintTop_toBottomOf="@+id/tvAccident"
app:layout_constraintLeft_toLeftOf="@+id/tvAccident"
android:layout_marginTop="@dimen/dp_62"
android:gravity="center"
android:drawablePadding="@dimen/dp_30" />
android:text="道路积冰"
android:textColor="#fff"
android:textSize="@dimen/dp_32"
app:layout_constraintLeft_toLeftOf="@+id/tvAccident"
app:layout_constraintRight_toRightOf="@+id/tvAccident"
app:layout_constraintTop_toTopOf="@+id/tvStagnantWater"/>
<ImageView
android:id="@+id/ivDenseFog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_30"
android:background="@drawable/module_share_btn_bg"
android:scaleType="center"
android:src="@drawable/share_dense_fog"
app:layout_constraintLeft_toLeftOf="@+id/tvDenseFog"
app:layout_constraintRight_toRightOf="@+id/tvDenseFog"
app:layout_constraintBottom_toTopOf="@+id/tvDenseFog"/>
<TextView
android:id="@+id/tvDenseFog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/share_dense_fog"
android:text="浓雾"
android:textSize="@dimen/dp_32"
android:textColor="#fff"
app:layout_constraintTop_toBottomOf="@+id/tvConstruction"
app:layout_constraintLeft_toLeftOf="@+id/tvConstruction"
android:layout_marginTop="@dimen/dp_62"
android:gravity="center"
android:drawablePadding="@dimen/dp_30" />
android:text="浓雾"
android:textColor="#fff"
android:textSize="@dimen/dp_32"
app:layout_constraintLeft_toLeftOf="@+id/tvConstruction"
app:layout_constraintRight_toRightOf="@+id/tvConstruction"
app:layout_constraintTop_toTopOf="@+id/tvRoadIcy"/>
</androidx.constraintlayout.widget.ConstraintLayout>