Update Android template instances - retake 2 (#13928)
This commit is contained in:
committed by
GitHub
parent
60c5fed12d
commit
c669c62ecf
@@ -15,8 +15,8 @@ apply plugin: 'com.android.application'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion '25.0.3'
|
||||
compileSdkVersion 26
|
||||
buildToolsVersion '26.0.3'
|
||||
|
||||
lintOptions {
|
||||
disable 'InvalidPackage'
|
||||
@@ -25,7 +25,7 @@ android {
|
||||
defaultConfig {
|
||||
applicationId "io.flutter.examples.platform_view"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 25
|
||||
targetSdkVersion 26
|
||||
versionCode 1
|
||||
versionName "0.0.1"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
@@ -45,9 +45,9 @@ flutter {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
androidTestCompile 'com.android.support:support-annotations:25.4.0'
|
||||
androidTestCompile 'com.android.support.test:runner:0.5'
|
||||
androidTestCompile 'com.android.support.test:rules:0.5'
|
||||
compile 'com.android.support:appcompat-v7:25.0.0'
|
||||
compile 'com.android.support:design:25.0.0'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.1'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
|
||||
implementation 'com.android.support:appcompat-v7:26.1.0'
|
||||
implementation 'com.android.support:design:26.1.0'
|
||||
}
|
||||
|
||||
@@ -22,14 +22,14 @@ public class CountActivity extends AppCompatActivity {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.android_full_screen_layout);
|
||||
Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
|
||||
Toolbar myToolbar = findViewById(R.id.my_toolbar);
|
||||
myToolbar.setTitle("Platform View");
|
||||
setSupportActionBar(myToolbar);
|
||||
|
||||
counter = getIntent().getIntExtra(EXTRA_COUNTER, 0);
|
||||
updateText();
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
FloatingActionButton fab = findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -38,7 +38,7 @@ public class CountActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
|
||||
Button switchViewButton = (Button) findViewById(R.id.button);
|
||||
Button switchViewButton = findViewById(R.id.button);
|
||||
switchViewButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -48,7 +48,7 @@ public class CountActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
private void updateText() {
|
||||
TextView textView = (TextView) findViewById(R.id.button_tap);
|
||||
TextView textView = findViewById(R.id.button_tap);
|
||||
String value = "Button tapped " + counter + (counter == 1 ? " time" : " times");
|
||||
textView.setText(value);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class MainActivity extends FlutterActivity {
|
||||
MainActivity.this.result = result;
|
||||
int count = methodCall.arguments();
|
||||
if (methodCall.method.equals(METHOD_SWITCH_VIEW)) {
|
||||
onlaunchFullScreen(count);
|
||||
onLaunchFullScreen(count);
|
||||
} else {
|
||||
result.notImplemented();
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class MainActivity extends FlutterActivity {
|
||||
);
|
||||
}
|
||||
|
||||
private void onlaunchFullScreen(int count) {
|
||||
private void onLaunchFullScreen(int count) {
|
||||
Intent fullScreenIntent = new Intent(this, CountActivity.class);
|
||||
fullScreenIntent.putExtra(CountActivity.EXTRA_COUNTER, count);
|
||||
startActivityForResult(fullScreenIntent, COUNT_REQUEST);
|
||||
|
||||
@@ -1,28 +1,26 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
maven {
|
||||
url "https://maven.google.com"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.3.3'
|
||||
classpath 'com.android.tools.build:gradle:3.0.1'
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
maven {
|
||||
url "https://maven.google.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
|
||||
|
||||
Reference in New Issue
Block a user