Android camera fixes, purchase screen fixes

This commit is contained in:
Ivan Murashov
2018-05-20 12:56:01 +03:00
parent be4f2dc7cf
commit 23a3bf1a9c
18 changed files with 659 additions and 285 deletions

View File

@@ -12,6 +12,7 @@ if (flutterRoot == null) {
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
@@ -24,7 +25,7 @@ android {
defaultConfig {
targetSdkVersion 27
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
minSdkVersion 16
applicationId "com.dinect.checker"
}
@@ -35,13 +36,13 @@ android {
}
release {
signingConfig signingConfigs.debug
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions "checker"
// Не смог разобраться, как коомбинировать flavors в flutter при запуске
productFlavors {
dinect {
@@ -174,16 +175,9 @@ android {
buildConfigField "boolean", "showBonus", "true"
}
}
sourceSets {
main.jniLibs.srcDir 'jniLibs'
pip {
res.srcDirs = ['src/pip/res']
manifest.srcFile 'src/pip/AndroidManifest.xml'
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
@@ -192,9 +186,17 @@ flutter {
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.squareup.okhttp3:okhttp:3.8.1'
compile 'com.squareup.okio:okio:1.13.0'
compile 'me.dm7.barcodescanner:zxing:1.9.8'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:support-media-compat:27.1.1'
implementation 'com.squareup.okhttp3:okhttp:3.9.0'
implementation 'com.squareup.okio:okio:1.13.0'
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
mavenCentral()
}

View File

@@ -4,10 +4,6 @@
android:versionCode="13"
android:versionName="1.1.18">
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="21"/>
<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
@@ -31,7 +27,7 @@
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Light.NoTitleBar"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
@@ -39,14 +35,10 @@
</intent-filter>
</activity>
<activity
android:name=".zbar.CameraActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme"/>
<activity
android:name=".zxing.ScannerActivity"
android:name=".ScannerActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme"/>
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
</application>
</manifest>

View File

@@ -1,48 +1,41 @@
package com.dinect.checker;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.widget.Toast;
import android.util.Log;
import com.dinect.checker.zbar.CameraActivity;
import com.dinect.checker.zxing.ScannerActivity;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Locale;
import java.util.Map;
import io.flutter.app.FlutterActivity;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugins.GeneratedPluginRegistrant;
import android.support.v4.app.Fragment;
import android.Manifest;
import android.content.pm.PackageManager;
import android.support.v4.content.ContextCompat;
import android.support.v4.app.ActivityCompat;
import android.content.pm.PackageInfo;
import java.util.*;
public class MainActivity extends FlutterActivity {
private static final int START_SCANNER_REQUEST_CODE = 2017;
private static final String FLUTTER_CHANNEL_NAME = "com.dinect.checker/instance_id";
private static final String ERROR_MESSAGE = "message";
static final String PREF_API_URL = "url";
static final String PREF_APP_TOKEN = "appToken";
static final String PREF_POS_TOKEN = "token";
static final String PREF_APP_BAR_COLOR = "color";
static final String SCANNER_BACKEND_KEY = "scanner_backend_idx";
static final int ZXING = 0;
static final int ZBAR = 1;
static final Class[] SCANNER_BACKEND = {
ScannerActivity.class,
CameraActivity.class,
};
private MethodChannel mChannel;
private Map mScannerArgs;
@@ -51,13 +44,7 @@ public class MainActivity extends FlutterActivity {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
mChannel = new MethodChannel(getFlutterView(), FLUTTER_CHANNEL_NAME);
mChannel.setMethodCallHandler(
new MethodChannel.MethodCallHandler() {
@Override
public void onMethodCall(MethodCall call, Result result) {
callMethod(call, result);
}
});
mChannel.setMethodCallHandler(this::callMethod);
}
private void callMethod(MethodCall call, Result result) {
@@ -72,8 +59,7 @@ public class MainActivity extends FlutterActivity {
result.success(BuildConfig.currency);
break;
case "startScanner":
mScannerArgs = call.arguments();
startScannerActivity();
startScannerActivity(call);
break;
case "isOnline":
checkInternetConnection(result);
@@ -97,7 +83,6 @@ public class MainActivity extends FlutterActivity {
result.success(BuildConfig.showBonus);
break;
case "finish":
Log.d("kifio", call.method);
finish();
break;
case "getVersionName":
@@ -110,18 +95,17 @@ public class MainActivity extends FlutterActivity {
}
private String getVersion() {
try {
PackageInfo pInfo = this.getPackageManager().getPackageInfo(getPackageName(), 0);
return pInfo.versionName;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return "";
}
try {
PackageInfo pInfo = this.getPackageManager().getPackageInfo(getPackageName(), 0);
return pInfo.versionName;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return "";
}
}
private String getLanguage() {
List<String> availableLanguages = Arrays.asList("ru", "en");
if (availableLanguages.contains(Locale.getDefault().getLanguage())) {
if (Arrays.asList("ru", "en").contains(Locale.getDefault().getLanguage())) {
return Locale.getDefault().getLanguage();
} else {
return BuildConfig.locale;
@@ -129,9 +113,10 @@ public class MainActivity extends FlutterActivity {
}
private void checkInternetConnection(Result result) {
boolean connected = Utils.isOnline(this);
if (!connected)
boolean connected = isOnline(this);
if (!connected) {
Toast.makeText(this, "Проверьте интернет соединение", Toast.LENGTH_SHORT).show();
}
result.success(connected);
}
@@ -144,36 +129,40 @@ public class MainActivity extends FlutterActivity {
res.updateConfiguration(configuration, res.getDisplayMetrics());
}
private void startScannerActivity(MethodCall call) {
mScannerArgs = call.arguments();
startScannerActivity();
}
private void startScannerActivity() {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[] {Manifest.permission.CAMERA}, 101);
} else {
final int idx = getSharedPreferences("scanner", Context.MODE_PRIVATE).getInt(
SCANNER_BACKEND_KEY, 0);
Intent cameraIntent = new Intent(MainActivity.this, SCANNER_BACKEND[idx]);
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA)
!= PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, 101);
} else {
openScanner();
}
}
private void openScanner() {
Intent cameraIntent = new Intent(MainActivity.this, ScannerActivity.class);
for (Object key : mScannerArgs.keySet()) {
if (key.equals("color")) {
cameraIntent.putExtra((String) key, Long.parseLong((String) mScannerArgs.get(key)));
} else {
cameraIntent.putExtra((String) key, (String) mScannerArgs.get(key));
}
if (key.equals("color")) {
cameraIntent.putExtra((String) key,
Long.parseLong((String) mScannerArgs.get(key)));
} else {
cameraIntent.putExtra((String) key, (String) mScannerArgs.get(key));
}
}
setLocale((String) mScannerArgs.get("localeCode"));
startActivityForResult(cameraIntent, START_SCANNER_REQUEST_CODE);
}
}
@Override
public void onRequestPermissionsResult(int requestCode,
String permissions[], int[] grantResults) {
if (requestCode == 101) {
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
startScannerActivity();
}
}
String permissions[], int[] grantResults) {
openScanner();
}
@Override
@@ -182,7 +171,7 @@ public class MainActivity extends FlutterActivity {
if (resultCode == RESULT_CANCELED) {
finish();
} else if (resultCode == RESULT_OK) {
if (data != null) {
if (data != null && data.getExtras() != null) {
String user = data.getExtras().getString("user", null);
if (user != null) {
String card = data.getExtras().getString("card", null);
@@ -193,11 +182,11 @@ public class MainActivity extends FlutterActivity {
} else {
String menuItem = data.getExtras().getString("item", null);
if (menuItem != null) {
if (menuItem.equals("exit")) {
finish();
} else {
mChannel.invokeMethod(menuItem, null);
}
if (menuItem.equals("exit")) {
finish();
} else {
mChannel.invokeMethod(menuItem, null);
}
}
}
} else {
@@ -207,51 +196,12 @@ public class MainActivity extends FlutterActivity {
}
}
public void getFlavor() {
private static boolean isOnline(Context context) {
NetworkInfo netInfo = getConnectivityManager(context).getActiveNetworkInfo();
return netInfo != null && netInfo.isConnected();
}
public void getCurrency() {
}
public void getLocale() {
}
public void setUserLocale() {
}
public void startScanner() {
}
public void isOnline() {
}
public void getSupportPhone() {
}
public void getSupportUrl() {
}
public void getEndpoint() {
}
public void getAppToken() {
}
public void getVersionName() {
}
public void setStrings() {
private static ConnectivityManager getConnectivityManager(Context context) {
return (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
}
}

View File

@@ -0,0 +1,383 @@
/*
* Copyright 2017 .
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.dinect.checker;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.provider.Settings;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.google.zxing.Result;
import org.json.JSONArray;
import org.json.JSONException;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import me.dm7.barcodescanner.zxing.ZXingScannerView;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Headers;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
/**
* Created by anonymous
*/
public class ScannerActivity extends AppCompatActivity implements
View.OnClickListener, ZXingScannerView.ResultHandler {
private final static String TAG = "Checker.ScannerActivity";
private static final int SCAN_INTERVAL_PERIOD = 500;
enum SearchType {
CARD,
PHONE_NUMBER
}
private ApiClient mClient;
private ImageView mButton;
private EditText mInputField;
private SearchType mSearchType;
private ZXingScannerView scannerView;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.a_zxing);
final String appToken = getIntent().getStringExtra(MainActivity.PREF_APP_TOKEN);
final String token = getIntent().getStringExtra(MainActivity.PREF_POS_TOKEN);
final String url = getIntent().getStringExtra(MainActivity.PREF_API_URL) + "/users/";
mClient = new ApiClient(url, appToken, token);
initToolbar(getIntent());
scannerView = new ZXingScannerView(this);
ViewGroup instructions = findViewById(R.id.instructions);
TextView text = (TextView) instructions.getChildAt(0);
text.setText(getIntent().getStringExtra("camera_instructions").replace("%s", BuildConfig.appTitle));
Button button = (Button) instructions.getChildAt(1);
button.setText(getIntent().getStringExtra("open_settings"));
button.setOnClickListener((v) ->
startActivityForResult(new Intent(Settings.ACTION_SETTINGS), 0));
}
@Override
public void onResume() {
super.onResume();
ViewGroup root = findViewById(R.id.zxingRoot);
int count = root.getChildCount();
if (root.getChildAt(count - 1).equals(scannerView)) {
scannerView.setResultHandler(this);
scannerView.startCamera();
} else if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.CAMERA)
== PackageManager.PERMISSION_GRANTED) {
View instructions = findViewById(R.id.instructions);
if (instructions != null) {
root.removeView(instructions);
}
root.addView(scannerView);
scannerView.setResultHandler(this);
scannerView.startCamera();
}
}
@Override
public void onPause() {
super.onPause();
scannerView.stopCamera();
}
@Override
public void onBackPressed() {
setResult(RESULT_CANCELED);
finish();
}
@Override
public void handleResult(Result raw) {
handleBarcode(raw.getText());
scannerView.postDelayed(() -> scannerView.resumeCameraPreview(ScannerActivity.this), SCAN_INTERVAL_PERIOD);
}
protected final void initToolbar(Intent intent) {
final Toolbar toolbar = findViewById(R.id.toolbar);
toolbar.setBackgroundColor((int) intent.getLongExtra(MainActivity.PREF_APP_BAR_COLOR, 0xffffff));
setSupportActionBar(toolbar);
final ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setTitle(null);
actionBar.setDisplayHomeAsUpEnabled(false);
}
initManualInput();
initSwitchButton();
}
private void initSwitchButton() {
mButton = findViewById(R.id.cardPhoneButton);
mButton.setOnClickListener(this);
resetSearchType(SearchType.CARD, R.drawable.ic_card, "enter_manual");
}
private void resetSearchType(SearchType type, int iconId, String hintKey) {
mSearchType = type;
mButton.setBackgroundResource(iconId);
mInputField.setHint(getIntent().getStringExtra(hintKey));
}
@Override
public void onClick(View v) {
if (mSearchType == SearchType.CARD) {
resetSearchType(SearchType.PHONE_NUMBER, R.drawable.ic_phone, "enter_phone");
} else {
resetSearchType(SearchType.CARD, R.drawable.ic_card, "enter_manual");
}
}
private void initManualInput() {
mInputField = findViewById(R.id.manual_input);
mInputField.setOnEditorActionListener((v, actionId, event) -> {
handleBarcode(v.getText().toString());
return false;
});
if (BuildConfig.DEBUG) {
if ("autobonus".equals(BuildConfig.FLAVOR)) {
mInputField.setText("9990010009012057060904229");
} else if ("dinect_INT".equals(BuildConfig.FLAVOR)) {
mInputField.setText("4620011139016337050236302");
}
}
}
public void handleBarcode(final @NonNull String searchString) {
mClient.findUser(searchString, mSearchType, new Callback() {
@Override
public void onFailure(Call call, IOException e) {
handleFail(searchString);
}
@Override
public void onResponse(Call call, Response response) {
try {
ResponseBody body = response.body();
if (body != null) {
switch (response.code()) {
case 200:
final JSONArray users = new JSONArray(body.string());
if (users.length() > 0) {
handleSuccess(searchString, users.get(0).toString());
} else {
handleFail(searchString);
}
break;
case 204:
handleFail(searchString);
break;
}
}
} catch (final IOException | JSONException e) {
Log.e(TAG, e.getMessage(), e);
handleFail(searchString);
}
}
});
}
protected final void handleSuccess(final String card, final String user) {
runOnUiThread(() -> {
setResult(RESULT_OK, new Intent().putExtra("user", user).putExtra("card", card));
finish();
});
}
protected final void handleFail(final String searchString) {
runOnUiThread(() -> {
String message = String.format(getIntent().getStringExtra("identifier_not_found"), searchString)
+ ".\n"
+ String.format(getIntent().getStringExtra("error_contact_support"), BuildConfig.supportPhone);
Toast.makeText(ScannerActivity.this, message, Toast.LENGTH_SHORT).show();
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu, menu);
return true;
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
MenuItem settings = menu.findItem(R.id.settings);
settings.setIcon(getResources().getDrawable(R.drawable.settings));
settings.setTitle(getIntent().getStringExtra("settings"));
MenuItem faq = menu.findItem(R.id.faq);
faq.setIcon(getResources().getDrawable(R.drawable.help));
faq.setTitle(getIntent().getStringExtra("faq"));
MenuItem exit = menu.findItem(R.id.exit);
exit.setIcon(getResources().getDrawable(R.drawable.exit));
exit.setTitle(getIntent().getStringExtra("exit"));
return super.onPrepareOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.settings) {
final Intent intent = new Intent();
intent.putExtra("item", "settings");
setResult(RESULT_OK, intent);
finish();
return true;
} else if (item.getItemId() == R.id.exit) {
exit();
return true;
} else if (item.getItemId() == R.id.faq) {
final Intent intent = new Intent();
intent.putExtra("item", "faq");
setResult(RESULT_OK, intent);
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
void exit() {
final Intent intent = new Intent();
intent.putExtra("item", "exit");
setResult(RESULT_OK, intent);
finish();
}
private static class ApiClient {
private static final int TIMEOUT = 3;
private OkHttpClient mHttp;
private String mEndpoint;
private ApiClient(final String url, final @NonNull String appToken, final @NonNull String token) {
mEndpoint = url;
mHttp = new OkHttpClient().
newBuilder()
.connectTimeout(TIMEOUT, TimeUnit.SECONDS)
.readTimeout(TIMEOUT, TimeUnit.SECONDS)
.writeTimeout(TIMEOUT, TimeUnit.SECONDS)
.addInterceptor(new DinectAuthorizationInterceptor(appToken, token, "checker/0.1", true))
.build();
}
private void findUser(String searchString, ScannerActivity.SearchType searchType, Callback callback) {
final Request.Builder requestBuilder = new Request.Builder();
final HttpUrl url = HttpUrl.parse(mEndpoint);
if (url != null) {
HttpUrl.Builder httpBuilder = url.newBuilder();
switch (searchType) {
case CARD:
httpBuilder.addQueryParameter("auto", searchString);
break;
case PHONE_NUMBER:
httpBuilder.addQueryParameter("phone", searchString);
break;
}
mHttp.newCall(requestBuilder.url(httpBuilder.build()).build()).enqueue(callback);
}
}
}
private static class DinectAuthorizationInterceptor implements Interceptor {
private final String token;
private final String appToken;
private final String dmAuthorization;
private final String authorization;
private final String userAgent;
private final boolean useAuthHeader;
DinectAuthorizationInterceptor(final String appToken, final String token, final String clientInfo, final boolean useAuthHeader) {
this.appToken = appToken;
this.token = token;
this.useAuthHeader = useAuthHeader;
userAgent = clientInfo;
dmAuthorization = "dmapptoken " + appToken;
authorization = "dmtoken " + token;
}
@Override
public Response intercept(Interceptor.Chain chain) throws IOException {
final Request originalRequest = chain.request();
final HttpUrl originalUrl = originalRequest.url();
final Request.Builder requestBuilder = originalRequest.newBuilder();
HttpUrl url = originalUrl;
Headers headers;
headers = originalRequest.headers();
final Headers.Builder headersBuilder = headers.newBuilder();
headersBuilder.set("User-Agent", userAgent);
if (useAuthHeader) {
headersBuilder.set("DM-Authorization", dmAuthorization);
if (null != token) {
headersBuilder.set("Authorization", authorization);
}
headers = headersBuilder.build();
} else {
final HttpUrl.Builder urlBuilder = originalRequest.url().newBuilder();
urlBuilder.addQueryParameter("_dmapptoken", appToken);
urlBuilder.addQueryParameter("user_agent", userAgent);
if (null != token) {
urlBuilder.addQueryParameter("_dmtoken", token);
}
url = urlBuilder.build();
}
final Request request = requestBuilder.url(url).headers(headers).build();
return chain.proceed(request);
}
}
}

View File

@@ -1,18 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/zxingRoot"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@android:color/white">
<include layout="@layout/v_custom_toolbar" />
<View
android:id="@+id/zxingToolbarShadow"
<LinearLayout
android:id="@+id/instructions"
android:layout_width="match_parent"
android:layout_height="4dp"
android:layout_marginTop="?attr/actionBarSize"
android:background="@drawable/shadow_bottom" />
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="72dp"
android:orientation="vertical">
</FrameLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="Для корректной работы приложения необходимо открыть Настройки, найти пункт Приложения, выбрать Autobonus, нажать на кнопку Разрешения, поставить галочку напротив слова Камера" />
<Button
android:id="@+id/openSettings"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_gravity="center"
android:text="Открыть настройки" />
</LinearLayout>
</LinearLayout>

View File

@@ -1,29 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:orientation="vertical"
android:minHeight="?attr/actionBarSize"
app:titleTextColor="@android:color/white">
<com.dinect.checker.StatedImageButton
android:id="@+id/cardPhoneButton"
android:layout_width="wrap_content"
android:layout_marginRight="12dp"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/manual_input"
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:imeOptions="actionDone"
android:inputType="text"
android:maxLines="1"
android:textColor="@android:color/white"
android:textColorHint="@android:color/white" />
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:minHeight="?attr/actionBarSize"
android:orientation="vertical"
app:titleTextColor="@android:color/white">
<ImageView
android:id="@+id/cardPhoneButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="12dp" />
<EditText
android:id="@+id/manual_input"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:imeOptions="actionDone"
android:inputType="text"
android:maxLines="1"
android:textColor="@android:color/white"
android:textColorHint="@android:color/white" />
<View
android:layout_width="match_parent"
android:layout_height="4dp"
android:layout_marginTop="?attr/actionBarSize"
android:background="@drawable/shadow_bottom" />
</android.support.v7.widget.Toolbar>

View File

@@ -1,34 +1,33 @@
buildscript {
repositories {
jcenter()
google()
}
ext.kotlin_version = '1.2.40'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
jcenter()
google()
maven {
url "https://maven.google.com"
}
}
repositories {
jcenter()
google()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
delete rootProject.buildDir
}
task wrapper(type: Wrapper) {
gradleVersion = '2.14.1'
gradleVersion = '2.14.1'
}