Commit 45d5814c1b2055965c5a0b8ee159b953d56bd61f
1 parent
3119571af6
Exists in
master
沉浸式状态栏; 布局优化;
Showing
5 changed files
with
14 additions
and
3 deletions
Show diff stats
app/build.gradle
... | ... | @@ -88,4 +88,9 @@ dependencies { |
88 | 88 | implementation("com.contrarywind:Android-PickerView:4.1.9") |
89 | 89 | |
90 | 90 | implementation 'com.google.android:flexbox:1.0.0' |
91 | + | |
92 | + // 沉浸式状态栏和他的Kotlin拓展 | |
93 | + implementation 'com.geyifeng.immersionbar:immersionbar:3.2.2' | |
94 | + implementation 'com.geyifeng.immersionbar:immersionbar-ktx:3.2.2' | |
95 | + | |
91 | 96 | } |
92 | 97 | \ No newline at end of file | ... | ... |
app/src/main/AndroidManifest.xml
... | ... | @@ -156,7 +156,8 @@ |
156 | 156 | <activity android:name=".HomeworkSelectActivity" /> |
157 | 157 | <activity android:name=".HomeworkFeedbackActivity" /> |
158 | 158 | <activity android:name=".HomeworkTopicActivity" /> |
159 | - <activity android:name=".HomeworkShareActivity" /> | |
159 | + <activity android:name=".HomeworkShareActivity" | |
160 | + android:screenOrientation="landscape"/> | |
160 | 161 | <activity android:name=".HuyouDetailActivity" /> |
161 | 162 | |
162 | 163 | <provider | ... | ... |
app/src/main/java/com/hjx/parent/HomeworkShareActivity.java
... | ... | @@ -17,6 +17,7 @@ import com.bumptech.glide.Glide; |
17 | 17 | import com.chad.library.adapter.base.BaseQuickAdapter; |
18 | 18 | import com.chad.library.adapter.base.BaseViewHolder; |
19 | 19 | import com.google.gson.Gson; |
20 | +import com.gyf.immersionbar.ImmersionBar; | |
20 | 21 | import com.hjx.parent.databinding.ActivityHomeworkShareBinding; |
21 | 22 | import com.hjx.parent.rx.BaseRxActivity; |
22 | 23 | import com.prws.common.bean.ResponseResult; |
... | ... | @@ -55,6 +56,7 @@ public class HomeworkShareActivity extends BaseRxActivity<ActivityHomeworkShareB |
55 | 56 | @SuppressLint("SetTextI18n") |
56 | 57 | @Override |
57 | 58 | public void initView(Bundle savedInstanceState) { |
59 | + ImmersionBar.with(this).init(); | |
58 | 60 | binding.btnBack.setOnClickListener(v -> onBackPressed()); |
59 | 61 | binding.rvWrong.setAdapter(mAdapter); |
60 | 62 | mAdapter.setEmptyView(R.layout.empty_statistical_no_error, binding.rvWrong); | ... | ... |
app/src/main/java/com/hjx/parent/HuyouDetailActivity.java
... | ... | @@ -25,6 +25,7 @@ import com.github.mikephil.charting.data.Entry; |
25 | 25 | import com.github.mikephil.charting.data.LineData; |
26 | 26 | import com.github.mikephil.charting.data.LineDataSet; |
27 | 27 | import com.github.mikephil.charting.formatter.ValueFormatter; |
28 | +import com.gyf.immersionbar.ImmersionBar; | |
28 | 29 | import com.hjx.parent.databinding.ActivityHuyouDetailBinding; |
29 | 30 | import com.hjx.parent.rx.BaseRxActivity; |
30 | 31 | import com.prws.common.bean.Student; |
... | ... | @@ -71,6 +72,7 @@ public class HuyouDetailActivity extends BaseRxActivity<ActivityHuyouDetailBindi |
71 | 72 | @SuppressLint("CheckResult") |
72 | 73 | @Override |
73 | 74 | public void initView(Bundle savedInstanceState) { |
75 | + ImmersionBar.with(this).init(); | |
74 | 76 | id = getIntent().getStringExtra("id"); |
75 | 77 | type = getIntent().getIntExtra("type", 0); |
76 | 78 | student = (Student) getIntent().getSerializableExtra("student"); | ... | ... |
app/src/main/res/layout/activity_homework_share.xml
... | ... | @@ -11,6 +11,7 @@ |
11 | 11 | |
12 | 12 | <androidx.appcompat.widget.Toolbar |
13 | 13 | app:contentInsetStart="0px" |
14 | + android:paddingTop="16dp" | |
14 | 15 | android:layout_width="match_parent" |
15 | 16 | android:layout_height="70dp"> |
16 | 17 | <androidx.appcompat.widget.AppCompatImageView |
... | ... | @@ -46,8 +47,7 @@ |
46 | 47 | </androidx.appcompat.widget.Toolbar> |
47 | 48 | |
48 | 49 | <androidx.core.widget.NestedScrollView |
49 | - android:layout_marginHorizontal="25dp" | |
50 | - android:layout_marginBottom="28dp" | |
50 | + android:layout_marginHorizontal="16dp" | |
51 | 51 | android:layout_width="match_parent" |
52 | 52 | android:layout_height="match_parent"> |
53 | 53 | <LinearLayout |
... | ... | @@ -56,6 +56,7 @@ |
56 | 56 | android:background="@drawable/bg_statistical_once_content" |
57 | 57 | android:paddingVertical="8dp" |
58 | 58 | android:paddingHorizontal="16dp" |
59 | + android:layout_marginBottom="16dp" | |
59 | 60 | android:layout_width="match_parent" |
60 | 61 | android:layout_height="wrap_content"> |
61 | 62 | <androidx.constraintlayout.utils.widget.ImageFilterView | ... | ... |