@@ -4,8 +4,6 @@ import android.app.Activity; | |||||
import android.os.Bundle; | import android.os.Bundle; | ||||
import androidx.core.content.ContextCompat; | import androidx.core.content.ContextCompat; | ||||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||||
public class MainActivity extends Activity { | public class MainActivity extends Activity { | ||||
@Override | @Override | ||||
@@ -13,8 +11,5 @@ public class MainActivity extends Activity { | |||||
super.onCreate(savedInstanceState); | super.onCreate(savedInstanceState); | ||||
setContentView(R.layout.activity_main); | setContentView(R.layout.activity_main); | ||||
QMUITopBarLayout mTopBar=findViewById(R.id.topbar); | |||||
mTopBar.setBackgroundColor(ContextCompat.getColor(this, R.color.app_color_theme_4)); | |||||
mTopBar.setTitle("沉浸式状态栏示例"); | |||||
} | } | ||||
} | } |
@@ -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; |
@@ -1,24 +1,16 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout | |||||
<RelativeLayout | |||||
xmlns:android="http://schemas.android.com/apk/res/android" | xmlns:android="http://schemas.android.com/apk/res/android" | ||||
xmlns:app="http://schemas.android.com/apk/res-auto" | xmlns:app="http://schemas.android.com/apk/res-auto" | ||||
xmlns:tools="http://schemas.android.com/tools" | xmlns:tools="http://schemas.android.com/tools" | ||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_height="match_parent" | android:layout_height="match_parent" | ||||
android:background="@mipmap/dpbj" | |||||
tools:context=".MainActivity"> | 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> |