Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Commit de6eeed

Browse files
committed
Fix Android build problems
1 parent 01ca288 commit de6eeed

File tree

8 files changed

+43
-33
lines changed

8 files changed

+43
-33
lines changed

.idea/misc.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ apply plugin: 'com.android.application'
33
apply plugin: 'kotlin-android'
44

55
apply plugin: 'kotlin-android-extensions'
6-
ext.anko_version = '0.10.4'
76

87
android {
98
compileSdkVersion 26
109
defaultConfig {
1110
applicationId "site.ddiu.tourval"
1211
minSdkVersion 21
13-
targetSdkVersion 26
12+
targetSdkVersion 27
1413
versionCode 1
1514
versionName "1.0"
1615
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -36,9 +35,10 @@ dependencies {
3635
androidTestImplementation 'com.android.support.test:runner:1.0.1'
3736
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
3837
implementation 'cn.hchstudio:kpermissions:1.0.8'
39-
implementation "org.jetbrains.anko:anko-commons:$anko_version"
38+
implementation "org.jetbrains.anko:anko-common:$anko_version"
4039
implementation 'com.amap.api:3dmap:latest.integration'
4140
implementation 'com.amap.api:search:latest.integration'
4241
implementation 'com.amap.api:location:latest.integration'
4342
implementation 'com.qmuiteam:qmui:1.0.6'
43+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
4444
}

app/src/main/java/site/ddiu/tourval/GaodeActivity.kt

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import com.amap.api.maps.CameraUpdateFactory
99
import com.amap.api.maps.model.MyLocationStyle
1010
import com.qmuiteam.qmui.util.QMUIStatusBarHelper
1111
import kotlinx.android.synthetic.main.activity_gaode.*
12+
import org.jetbrains.anko.act
13+
import org.jetbrains.anko.toast
1214
import java.io.File
1315
import java.io.FileOutputStream
1416
import java.io.IOException
@@ -23,6 +25,11 @@ class GaodeActivity : AppCompatActivity() {
2325
setContentView(R.layout.activity_gaode)
2426

2527
QMUIStatusBarHelper.translucent(this) //沉浸化状态栏
28+
QMUIStatusBarHelper.setStatusBarLightMode(act) //设置状态栏黑色字体图标
29+
editText.top = QMUIStatusBarHelper.getStatusbarHeight(this)
30+
// toast(QMUIStatusBarHelper.getStatusbarHeight(this).toString())
31+
Log.d("BAR",QMUIStatusBarHelper.getStatusbarHeight(this).toString())
32+
2633

2734
//在activity执行onCreate时执行mMapView.onCreate(savedInstanceState),创建地图
2835
amapView.onCreate(savedInstanceState)

app/src/main/java/site/ddiu/tourval/MainActivity.kt

+1-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ class MainActivity : AppCompatActivity() {
2828
}
2929

3030
fun testFun (view: View) {
31-
toast("fun1")
31+
toast("fun16带动带7")
3232
}
3333

34-
fun testFun2 (view: View) {
35-
toast("fun2")
36-
}
3734
}

app/src/main/res/layout/activity_gaode.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
android:layout_height="wrap_content"
2424
android:layout_marginEnd="8dp"
2525
android:layout_marginStart="8dp"
26-
android:layout_marginTop="32dp"
27-
android:background="#bbffffff"
26+
android:layout_marginTop="64dp"
27+
android:background="#ffffff"
2828
android:ems="10"
2929
android:inputType="textPersonName"
3030
android:padding="8dp"
31-
android:text="Name"
31+
android:text="bbjkhjkhjk"
3232
app:layout_constraintEnd_toEndOf="parent"
3333
app:layout_constraintStart_toStartOf="parent"
3434
app:layout_constraintTop_toTopOf="parent" />

app/src/main/res/layout/activity_main.xml

+25-17
Original file line numberDiff line numberDiff line change
@@ -18,43 +18,51 @@
1818
app:layout_constraintTop_toTopOf="parent"
1919
app:srcCompat="@drawable/test" />
2020

21-
<ImageView
22-
android:id="@+id/imageView2"
23-
android:layout_width="0dp"
24-
android:layout_height="314dp"
25-
android:layout_marginBottom="8dp"
26-
android:background="@color/qmui_config_color_50_white"
27-
android:onClick="testFun2"
28-
app:layout_constraintBottom_toBottomOf="parent"
29-
app:layout_constraintEnd_toEndOf="parent"
30-
app:layout_constraintStart_toStartOf="parent" />
31-
3221
<Button
3322
android:id="@+id/btn_switch"
34-
android:layout_width="0dp"
23+
android:layout_width="wrap_content"
3524
android:layout_height="wrap_content"
36-
android:layout_marginBottom="96dp"
25+
android:layout_marginBottom="8dp"
3726
android:layout_marginEnd="8dp"
3827
android:layout_marginStart="8dp"
3928
android:onClick="switchGaode"
4029
android:text="进入地图"
41-
app:layout_constraintBottom_toBottomOf="parent"
30+
app:layout_constraintBottom_toTopOf="@+id/test1"
4231
app:layout_constraintEnd_toEndOf="parent"
43-
app:layout_constraintHorizontal_bias="0.0"
4432
app:layout_constraintStart_toStartOf="parent" />
4533

4634
<Button
4735
android:id="@+id/button"
48-
android:layout_width="0dp"
36+
android:layout_width="wrap_content"
4937
android:layout_height="wrap_content"
5038
android:layout_marginBottom="8dp"
5139
android:layout_marginEnd="8dp"
5240
android:layout_marginStart="8dp"
41+
android:layout_marginTop="8dp"
5342
android:onClick="switchLayout"
5443
android:text="LayoutTest"
5544
app:layout_constraintBottom_toTopOf="@+id/btn_switch"
5645
app:layout_constraintEnd_toEndOf="parent"
57-
app:layout_constraintStart_toStartOf="parent" />
46+
app:layout_constraintStart_toStartOf="parent"
47+
app:layout_constraintTop_toTopOf="@+id/imageView" />
48+
49+
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
50+
android:id="@+id/test1"
51+
android:layout_width="wrap_content"
52+
android:layout_height="wrap_content"
53+
android:layout_centerInParent="true"
54+
android:layout_marginBottom="8dp"
55+
android:layout_marginEnd="8dp"
56+
android:layout_marginStart="8dp"
57+
android:paddingBottom="10dp"
58+
android:paddingLeft="16dp"
59+
android:paddingRight="16dp"
60+
android:paddingTop="10dp"
61+
android:text="圆角为高度的一半"
62+
app:layout_constraintBottom_toBottomOf="@+id/imageView"
63+
app:layout_constraintEnd_toEndOf="parent"
64+
app:layout_constraintStart_toStartOf="parent"
65+
app:qmui_isRadiusAdjustBounds="true" />
5866

5967

6068
</android.support.constraint.ConstraintLayout>

build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4+
ext.support_version = '23.1.1'
45
ext.kotlin_version = '1.2.31'
6+
ext.anko_version = '0.8.2'
57
repositories {
68
google()
79
jcenter()

gradle.properties

+1-5
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,4 @@
1313
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1414
# org.gradle.parallel=true
1515
#Wed Mar 28 09:48:37 CST 2018
16-
systemProp.http.proxyHost=127.0.0.1
17-
org.gradle.jvmargs=-Xmx1536m
18-
systemProp.http.proxyPort=1085
19-
org.gradle.daemon=true
20-
kotlin.incremental=true
16+
org.gradle.jvmargs=-Xmx1536m

0 commit comments

Comments
 (0)