Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # skin/mogo-skin-light/build.gradle
This commit is contained in:
@@ -2,6 +2,8 @@ package com.mogo.module.extensions.bean;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 底层view封装
|
||||
*
|
||||
@@ -12,7 +14,8 @@ public class BottomLayerViewWrapper {
|
||||
private int x;
|
||||
private int y;
|
||||
|
||||
public BottomLayerViewWrapper(){}
|
||||
public BottomLayerViewWrapper() {
|
||||
}
|
||||
|
||||
public BottomLayerViewWrapper(View view, int x, int y) {
|
||||
this.view = view;
|
||||
@@ -20,6 +23,25 @@ public class BottomLayerViewWrapper {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
BottomLayerViewWrapper wrapper = (BottomLayerViewWrapper) o;
|
||||
return x == wrapper.x &&
|
||||
y == wrapper.y &&
|
||||
view.equals(wrapper.view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(view);
|
||||
}
|
||||
|
||||
public View getView() {
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.ConstraintSet;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
@@ -56,6 +57,8 @@ import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.service.windowview.IMogoTopViewStatusListener;
|
||||
import com.mogo.utils.LaunchUtils;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.TipDrawable;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.glide.GlideApp;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -319,9 +322,25 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
mUploadButtonAnimatorController = new UploadButtonAnimatorController(mUploading, mUpload,
|
||||
mStatusManager);
|
||||
|
||||
dealWeatherContainer();
|
||||
|
||||
debugTopView();
|
||||
}
|
||||
|
||||
/**
|
||||
* 由于Launcher和Independent对于天气的表现形式不太一样,所以通过此方法区分处理
|
||||
*/
|
||||
private void dealWeatherContainer(){
|
||||
if (!DebugConfig.isLauncher()) {
|
||||
ConstraintSet constraintSet = new ConstraintSet();
|
||||
constraintSet.clone((ConstraintLayout) getView());
|
||||
constraintSet.clear(R.id.module_ext_id_weather_container,ConstraintSet.START);
|
||||
constraintSet.connect(R.id.module_ext_id_weather_container, ConstraintSet.END,
|
||||
getView().getId(), ConstraintSet.END);
|
||||
constraintSet.applyTo((ConstraintLayout) getView());
|
||||
}
|
||||
}
|
||||
|
||||
public void showShareDialog() {
|
||||
isClickShare = true;
|
||||
mApis.getShareManager().showShareDialog();
|
||||
@@ -601,6 +620,21 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
tv.setText("entrance add");
|
||||
mApis.getEntranceButtonController().addBottomLayerView(tv, 50, 50);
|
||||
});
|
||||
findViewById(R.id.btnShowTextTip).setOnClickListener(v-> TipToast.tip("分享成功"));
|
||||
|
||||
findViewById(R.id.btnShowDrawableTip).setOnClickListener(v->{
|
||||
mMsgContainer.setVisibility(View.VISIBLE);
|
||||
// TipDrawable drawable =
|
||||
// new TipDrawable(getResources().getDrawable(R.drawable.model_ext_default_user_head), 150, 150);
|
||||
// TipToast.tip("分享成功",drawable);
|
||||
});
|
||||
|
||||
findViewById(R.id.btnShowDrawableTipNoSize).setOnClickListener(v->{
|
||||
mMsgContainer.setVisibility(View.GONE);
|
||||
// TipDrawable drawable =
|
||||
// new TipDrawable(getResources().getDrawable(R.drawable.model_ext_default_user_head));
|
||||
// TipToast.tip("分享成功",drawable);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -58,12 +58,26 @@ public class EntranceViewHolder {
|
||||
"\n x: " + x + ", y: " + y);
|
||||
BottomLayerViewWrapper wrapper = new BottomLayerViewWrapper(view, x, y);
|
||||
if(rootViewGroup == null) {
|
||||
preAddView.add(wrapper);
|
||||
if(!preAddView.contains(wrapper)) {
|
||||
preAddView.add(wrapper);
|
||||
}
|
||||
}else{
|
||||
realAddView(wrapper);
|
||||
if(!containView(view)) {
|
||||
realAddView(wrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean containView(View view) {
|
||||
int count = rootViewGroup.getChildCount();
|
||||
for (int i = 0; i < count; i++) {
|
||||
if(rootViewGroup.getChildAt(i).equals(view)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用的时候需要预先判断rootViewGroup是否为空,本方法默认rootViewGroup不为空
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
<include
|
||||
layout="@layout/include_navi_info_panle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_ext_id_north"
|
||||
@@ -26,7 +27,7 @@
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingTop="@dimen/dp_14"
|
||||
android:text="@string/mode_north_up"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/module_ext_color_voice_text"
|
||||
android:textSize="@dimen/module_ext_north_textSize"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
@@ -71,7 +72,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:text="全览"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/module_ext_color_voice_text"
|
||||
android:textSize="@dimen/module_ext_display_overview_textSize_large"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
@@ -174,6 +175,7 @@
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnDebugCtrlTopView"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -210,11 +212,37 @@
|
||||
app:layout_constraintBottom_toTopOf="@id/btnDebugCtrlNaviView"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnShowTextTip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="显示文字tip"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toTopOf="@id/btnDebugAddBottomLayerView"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnShowDrawableTip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="显示图文tip"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toTopOf="@id/btnShowTextTip"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
<Button
|
||||
android:id="@+id/btnShowDrawableTipNoSize"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="显示图文tip,没有大小"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toTopOf="@id/btnShowDrawableTip"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/groupTopViewDebug"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="btnDebugCtrlNaviView,btnDebugCtrlSubView,btnDebugCtrlTopView,btnDebugAddBottomLayerView" />
|
||||
app:constraint_referenced_ids="btnShowDrawableTipNoSize,btnShowDrawableTip,btnShowTextTip,btnDebugCtrlNaviView,btnDebugCtrlSubView,btnDebugCtrlTopView,btnDebugAddBottomLayerView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
<LinearLayout
|
||||
@@ -12,10 +12,11 @@
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/module_ext_weather_container_paddingLeft"
|
||||
android:paddingEnd="@dimen/module_ext_weather_container_paddingRight"
|
||||
android:layout_marginEnd="@dimen/module_ext_msg_marginRight"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintRight_toLeftOf="@+id/module_ext_id_msg"
|
||||
app:layout_goneMarginLeft="@dimen/module_ext_notice_margin_start"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_ext_id_msg"
|
||||
android:layout_marginStart="@dimen/module_ext_weather_margin_start"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
@@ -36,13 +37,14 @@
|
||||
android:id="@+id/module_ext_id_msg"
|
||||
android:layout_width="@dimen/module_ext_height"
|
||||
android:layout_height="@dimen/module_ext_height"
|
||||
android:layout_marginStart="@dimen/module_ext_notice_margin_start"
|
||||
android:layout_marginEnd="@dimen/module_ext_msg_marginRight"
|
||||
android:background="@drawable/module_ext_drawable_msg_container_bkg"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ivUserHeadImg"
|
||||
app:layout_constraintRight_toLeftOf="@+id/ivUserHeadImg"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/ivUserHeadImg"
|
||||
tools:visibility="gone">
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -70,8 +72,8 @@
|
||||
android:layout_width="@dimen/module_ext_height"
|
||||
android:layout_height="@dimen/module_ext_height"
|
||||
android:src="@drawable/model_ext_default_user_head"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_ext_id_weather_container"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_ext_id_weather_container"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_ext_id_weather_container"
|
||||
tools:visibility="gone"/>
|
||||
tools:visibility="gone" />
|
||||
</merge>
|
||||
@@ -144,4 +144,6 @@
|
||||
<dimen name="module_ext_display_overview_icon_marginTop">20px</dimen>
|
||||
|
||||
<dimen name="module_ext_top_over_navi_height">34px</dimen>
|
||||
<dimen name="module_ext_notice_margin_start">175px</dimen>
|
||||
<dimen name="module_ext_weather_margin_start">30px</dimen>
|
||||
</resources>
|
||||
@@ -60,6 +60,8 @@
|
||||
<dimen name="module_ext_paddingRight">32px</dimen>
|
||||
<dimen name="module_ext_paddingLeft">32px</dimen>
|
||||
|
||||
<dimen name="module_ext_notice_margin_start">98px</dimen>
|
||||
|
||||
<dimen name="module_ext_voice_textSize">22px</dimen>
|
||||
<dimen name="module_ext_time_textSize">28px</dimen>
|
||||
<dimen name="module_ext_date_marginRight">22px</dimen>
|
||||
@@ -148,4 +150,6 @@
|
||||
<dimen name="module_ext_display_overview_icon_marginTop">10px</dimen>
|
||||
|
||||
<dimen name="module_ext_top_over_navi_height">19px</dimen>
|
||||
<dimen name="module_ext_weather_margin_start">16px</dimen>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user