全面屏标题栏适配

This commit is contained in:
jinyuer
2021-12-13 15:30:30 +08:00
parent d23b9c54f3
commit d3a9e415c8
10 changed files with 206 additions and 32 deletions

13
.idea/misc.xml generated
View File

@@ -8,13 +8,26 @@
<component name="DesignSurface"> <component name="DesignSurface">
<option name="filePathToZoomLevelMap"> <option name="filePathToZoomLevelMap">
<map> <map>
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/activity_add_address.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/activity_add_discovery.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/activity_adevise.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/activity_like.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/activity_login.xml" value="0.3614583333333333" /> <entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/activity_login.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/activity_logo.xml" value="0.3614583333333333" /> <entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/activity_logo.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/activity_main.xml" value="0.3614583333333333" /> <entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/activity_main.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/activity_modify_pswd.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/activity_my_fee_bill_history.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/activity_my_property.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/activity_my_user_message.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/activity_propery.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/activity_setting.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/dialog_initmate.xml" value="0.3614583333333333" /> <entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/dialog_initmate.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/fragment_discovery.xml" value="0.3614583333333333" /> <entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/fragment_discovery.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/fragment_like.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/fragment_main.xml" value="0.3614583333333333" /> <entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/fragment_main.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/fragment_main3.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/item_discovery.xml" value="0.3614583333333333" /> <entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/item_discovery.xml" value="0.3614583333333333" />
<entry key="..\:/AndroidStudioProject/HouseProperty/app/src/main/res/layout/layout_history_record.xml" value="0.3614583333333333" />
</map> </map>
</option> </option>
</component> </component>

View File

@@ -7,6 +7,7 @@ import android.view.Gravity;
import android.view.View; import android.view.View;
import android.widget.Toast; import android.widget.Toast;
import com.gyf.immersionbar.ImmersionBar;
import com.sl.house_property.databinding.ActivityAdeviseBinding; import com.sl.house_property.databinding.ActivityAdeviseBinding;
import java.util.HashMap; import java.util.HashMap;
@@ -32,12 +33,11 @@ public class AdeviseActivity extends BaseActivity<ActivityAdeviseBinding> {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setAbr("意见反馈", new View.OnClickListener() { ImmersionBar.with(this)
@Override .keyboardEnable(true) //解决软键盘与底部输入框冲突问题
public void onClick(View view) { // .keyboardEnable(true, WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE
finish(); // | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) //软键盘自动弹出
} .init();
},0,null,0,null,0,null,"");
mDataBinding.comimit.setOnClickListener(new View.OnClickListener(){ mDataBinding.comimit.setOnClickListener(new View.OnClickListener(){
@Override @Override
public void onClick(View view) { public void onClick(View view) {
@@ -55,7 +55,12 @@ public class AdeviseActivity extends BaseActivity<ActivityAdeviseBinding> {
} }
}); });
mDataBinding.left.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
mDataBinding.connent.addTextChangedListener(new TextWatcher() { mDataBinding.connent.addTextChangedListener(new TextWatcher() {
@Override @Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {

View File

@@ -5,6 +5,7 @@ import android.view.Gravity;
import android.view.View; import android.view.View;
import android.widget.Toast; import android.widget.Toast;
import com.gyf.immersionbar.ImmersionBar;
import com.sl.house_property.databinding.ActivityModifyPswdBinding; import com.sl.house_property.databinding.ActivityModifyPswdBinding;
import java.util.HashMap; import java.util.HashMap;
@@ -33,16 +34,26 @@ public class ModifyPswdActivity extends BaseActivity<ActivityModifyPswdBinding>
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
ImmersionBar.with(this)
setAbr(getString(R.string.modifypwsd), new View.OnClickListener() { .keyboardEnable(true) //解决软键盘与底部输入框冲突问题
@Override // .keyboardEnable(true, WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE
public void onClick(View view) { // | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) //软键盘自动弹出
finish(); .init();
} // setAbr(getString(R.string.modifypwsd), new View.OnClickListener() {
}, 0, null, 0, null, 0, null, ""); // @Override
// public void onClick(View view) {
// finish();
// }
// }, 0, null, 0, null, 0, null, "");
//
mDataBinding.register.setOnClickListener(this); mDataBinding.register.setOnClickListener(this);
mDataBinding.left.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
} }

View File

@@ -7,6 +7,7 @@ import android.os.Message;
import android.view.View; import android.view.View;
import android.widget.Toast; import android.widget.Toast;
import com.gyf.immersionbar.ImmersionBar;
import com.sl.house_property.databinding.ActivitySettingBinding; import com.sl.house_property.databinding.ActivitySettingBinding;
import cn.jpush.android.api.JPushInterface; import cn.jpush.android.api.JPushInterface;
@@ -48,18 +49,22 @@ public class SettingActivity extends BaseActivity<ActivitySettingBinding> implem
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setAbr("系统设置", new View.OnClickListener() { ImmersionBar.with(this)
@Override .keyboardEnable(false) //解决软键盘与底部输入框冲突问题
public void onClick(View view) { // .keyboardEnable(true, WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE
finish(); // | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) //软键盘自动弹出
} .init();
}, 0, null, 0, null, 0, null, "");
mDataBinding.id1.setOnClickListener(this); mDataBinding.id1.setOnClickListener(this);
mDataBinding.id2.setOnClickListener(this); mDataBinding.id2.setOnClickListener(this);
mDataBinding.id3.setOnClickListener(this); mDataBinding.id3.setOnClickListener(this);
mDataBinding.loginout.setOnClickListener(this); mDataBinding.loginout.setOnClickListener(this);
mDataBinding.id0.setOnClickListener(this); mDataBinding.id0.setOnClickListener(this);
mDataBinding.left.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
mDataBinding.myverion.setText("V" + APKVersionCodeUtils.getVerName(SettingActivity.this)); mDataBinding.myverion.setText("V" + APKVersionCodeUtils.getVerName(SettingActivity.this));
try { try {
mDataBinding.cachsiez.setText(CacheDataManager.getTotalCacheSize(SettingActivity.this)); mDataBinding.cachsiez.setText(CacheDataManager.getTotalCacheSize(SettingActivity.this));

View File

@@ -10,6 +10,7 @@ import android.view.View;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.internal.LinkedTreeMap; import com.google.gson.internal.LinkedTreeMap;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import com.gyf.immersionbar.ImmersionBar;
import com.lxj.xpopup.XPopup; import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.interfaces.OnInputConfirmListener; import com.lxj.xpopup.interfaces.OnInputConfirmListener;
import com.selectpicker.OptionsPopupWindow; import com.selectpicker.OptionsPopupWindow;
@@ -57,12 +58,23 @@ public class MyPropertyActivity extends BaseActivity<ActivityMyPropertyBinding>
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setAbr("我的房产", new View.OnClickListener() { // setAbr("我的房产", new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// finish();
// }
// }, 0, null, 0, null, 0, null, "");
ImmersionBar.with(this)
.keyboardEnable(false) //解决软键盘与底部输入框冲突问题
// .keyboardEnable(true, WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE
// | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) //软键盘自动弹出
.init();
mDataBinding.left.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View v) {
finish(); finish();
} }
}, 0, null, 0, null, 0, null, ""); });
FullyGridLayoutManager mgr = new FullyGridLayoutManager(MyPropertyActivity.this, 1); FullyGridLayoutManager mgr = new FullyGridLayoutManager(MyPropertyActivity.this, 1);
mgr.setOrientation(FullyGridLayoutManager.VERTICAL); mgr.setOrientation(FullyGridLayoutManager.VERTICAL);
mgr.setSmoothScrollbarEnabled(true); mgr.setSmoothScrollbarEnabled(true);

View File

@@ -5,8 +5,40 @@
> >
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:fitsSystemWindows="true" android:orientation="vertical"
android:layout_height="match_parent"> android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="@dimen/mystatusbar"
android:orientation="horizontal">
<ImageView
android:id="@+id/left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:paddingLeft="16dp"
android:paddingTop="5dp"
android:paddingRight="5dp"
android:paddingBottom="5dp"
android:src="@mipmap/fanhui" />
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="意见反馈"
android:textColor="@color/white"
android:textSize="16sp" />
</RelativeLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:orientation="vertical" android:orientation="vertical"

View File

@@ -7,8 +7,40 @@
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:fitsSystemWindows="true"
android:layout_height="match_parent"> android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="@dimen/mystatusbar"
android:orientation="horizontal">
<ImageView
android:id="@+id/left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:paddingLeft="16dp"
android:paddingTop="5dp"
android:paddingRight="5dp"
android:paddingBottom="5dp"
android:src="@mipmap/fanhui" />
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="修改登录密码"
android:textColor="@color/white"
android:textSize="16sp" />
</RelativeLayout>
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -6,8 +6,40 @@
tools:context=".f1.AddcararageIttemActivity"> tools:context=".f1.AddcararageIttemActivity">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:fitsSystemWindows="true" android:orientation="vertical"
android:layout_height="match_parent"> android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="@dimen/mystatusbar"
android:orientation="horizontal">
<ImageView
android:id="@+id/left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:paddingLeft="16dp"
android:paddingTop="5dp"
android:paddingRight="5dp"
android:paddingBottom="5dp"
android:src="@mipmap/fanhui" />
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="我的房产"
android:textColor="@color/white"
android:textSize="16sp" />
</RelativeLayout>
<my_view.tao_bao_refresh.ScrollViewExtend <my_view.tao_bao_refresh.ScrollViewExtend
android:layout_width="match_parent" android:layout_width="match_parent"
android:background="@color/f7" android:background="@color/f7"

View File

@@ -8,8 +8,40 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true"> android:orientation="vertical"
>
<RelativeLayout
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="@dimen/mystatusbar"
android:orientation="horizontal">
<ImageView
android:id="@+id/left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:paddingLeft="16dp"
android:paddingTop="5dp"
android:paddingRight="5dp"
android:paddingBottom="5dp"
android:src="@mipmap/fanhui" />
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="设置"
android:textColor="@color/white"
android:textSize="16sp" />
</RelativeLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"

View File

@@ -28,14 +28,14 @@
android:src="@mipmap/fanhui" /> android:src="@mipmap/fanhui" />
<TextView <TextView
android:id="@+id/tv_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:gravity="center" android:gravity="center"
android:textSize="16sp"
android:id="@+id/tv_title"
android:text="哈哈" android:text="哈哈"
android:textColor="@color/white" /> android:textColor="@color/white"
android:textSize="16sp" />
</RelativeLayout> </RelativeLayout>