Browse Source

完成登录界面333

master
fyf 1 year ago
parent
commit
d76d6d2bfb
4 changed files with 27 additions and 22 deletions
  1. BIN
     
  2. +0
    -5
      app/src/main/java/com/example/chabaidao/MainActivity.java
  3. +18
    -0
      app/src/main/java/com/example/chabaidao/helper/ContextHolder.kt
  4. +9
    -17
      app/src/main/res/layout/activity_main.xml

BIN
View File


+ 0
- 5
app/src/main/java/com/example/chabaidao/MainActivity.java View File

@@ -4,8 +4,6 @@ import android.app.Activity;
import android.os.Bundle;
import androidx.core.content.ContextCompat;

import com.qmuiteam.qmui.widget.QMUITopBarLayout;

public class MainActivity extends Activity {

@Override
@@ -13,8 +11,5 @@ public class MainActivity extends Activity {

super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
QMUITopBarLayout mTopBar=findViewById(R.id.topbar);
mTopBar.setBackgroundColor(ContextCompat.getColor(this, R.color.app_color_theme_4));
mTopBar.setTitle("沉浸式状态栏示例");
}
}

+ 18
- 0
app/src/main/java/com/example/chabaidao/helper/ContextHolder.kt View File

@@ -0,0 +1,18 @@
/*
* Tencent is pleased to support the open source community by making QMUI_Android available.
*
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the MIT License (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* http://opensource.org/licenses/MIT
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.chabaidao;
import android.content.Context
val appContext: Context = MyApplication.instance.applicationContext;

+ 9
- 17
app/src/main/res/layout/activity_main.xml View File

@@ -1,24 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/dpbj"
tools:context=".MainActivity">

<com.qmuiteam.qmui.widget.QMUITopBarLayout
android:id="@+id/topbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"

android:fitsSystemWindows="true">
</com.qmuiteam.qmui.widget.QMUITopBarLayout>

<!-- <com.qmuiteam.qmui.widget.QMUILoadingView-->
<!-- android:id="@+id/loadView"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="50dp">-->

<!-- </com.qmuiteam.qmui.widget.QMUILoadingView>-->
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="我是主界面"
android:textSize="30dp">
</TextView>
</RelativeLayout>

Loading…
Cancel
Save