0
0
Fork 0
mirror of https://github.com/YTVanced/VancedMicroG synced 2024-11-27 21:53:00 +00:00

fixed kotlin file detection

This commit is contained in:
X1nto 2020-07-29 09:33:53 +04:00
parent e19000db17
commit d5ec9f8e7b
6 changed files with 244 additions and 2 deletions

View file

@ -15,6 +15,8 @@
*/ */
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
dependencies { dependencies {
implementation "com.squareup.wire:wire-runtime:1.6.1" implementation "com.squareup.wire:wire-runtime:1.6.1"
@ -55,8 +57,6 @@ android {
minSdkVersion androidMinSdk minSdkVersion androidMinSdk
targetSdkVersion androidTargetSdk targetSdkVersion androidTargetSdk
multiDexEnabled true
ndk { ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
} }
@ -70,6 +70,7 @@ android {
sourceSets { sourceSets {
main { main {
java.srcDirs += 'src/main/protos-java' java.srcDirs += 'src/main/protos-java'
java.srcDirs += 'src/main/kotlin'
} }
} }

View file

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ SPDX-FileCopyrightText: 2020, microG Project Team
~ SPDX-License-Identifier: Apache-2.0
-->
<layout 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">
<data>
<variable
name="checkinEnabled"
type="boolean" />
<variable
name="switchBarCallback"
type="org.microg.gms.ui.PreferenceSwitchBarCallback" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
layout="@layout/preference_switch_bar"
app:callback="@{switchBarCallback}"
app:checked="@{checkinEnabled}"
app:description='@{"Register device"}'
app:enabled="@{true}" />
<androidx.fragment.app.FragmentContainerView
android:id="@+id/sub_preferences"
android:name="org.microg.gms.ui.DeviceRegistrationPreferencesFragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout>
</layout>

View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ SPDX-FileCopyrightText: 2020, microG Project Team
~ SPDX-License-Identifier: Apache-2.0
-->
<layout 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">
<data>
<variable
name="checked"
type="boolean" />
<variable
name="enabled"
type="boolean" />
<variable
name="description"
type="String" />
<variable
name="callback"
type="org.microg.gms.ui.PreferenceSwitchBarCallback" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:clickable="@{enabled}"
android:focusable="@{enabled}"
android:gravity="center"
android:onClick="@{(v) -> callback.onChecked(!Boolean.valueOf(checked))}"
android:orientation="horizontal"
android:paddingStart="?attr/listPreferredItemPaddingStart"
android:paddingLeft="?attr/listPreferredItemPaddingLeft"
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
android:paddingRight="?attr/listPreferredItemPaddingRight"
app:backgroundColorAttr="@{checked ? androidx.appcompat.R.attr.colorControlActivated : (enabled ? androidx.appcompat.R.attr.colorButtonNormal : androidx.appcompat.R.attr.colorControlHighlight)}"
tools:background="?attr/colorControlActivated">
<TextView
android:id="@android:id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="2"
android:paddingStart="56dp"
android:paddingLeft="56dp"
android:text="@{description}"
android:textAppearance="?attr/textAppearanceListItem"
android:textColor="?android:attr/textColorPrimaryInverse"
tools:text="Enabled" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_widget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@null"
android:checked="@{checked}"
android:enabled="@{enabled}"
app:onCheckedChangeListener="@{(v, newStatus) -> callback.onChecked(newStatus)}"
app:thumbTint="?android:attr/textColorPrimaryInverse"
app:trackTint="?android:attr/textColorSecondaryInverse"
tools:checked="true" />
</LinearLayout>
</layout>

View file

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ SPDX-FileCopyrightText: 2020, microG Project Team
~ SPDX-License-Identifier: Apache-2.0
-->
<layout 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">
<data>
<variable
name="appName"
type="String" />
<variable
name="appIcon"
type="android.graphics.drawable.Drawable" />
<variable
name="callbacks"
type="org.microg.gms.ui.PushNotificationAppFragmentCallbacks" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:paddingStart="?attr/listPreferredItemPaddingStart"
android:paddingLeft="?attr/listPreferredItemPaddingLeft"
android:paddingTop="24dp"
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
android:paddingRight="?attr/listPreferredItemPaddingRight"
android:paddingBottom="16dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:onClick='@{() -> callbacks.onAppClicked()}'
android:orientation="vertical">
<ImageView
android:id="@+id/icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:antialias="true"
android:scaleType="fitCenter"
android:src="@{appIcon}"
tools:src="@android:mipmap/sym_def_app_icon" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:ellipsize="marquee"
android:gravity="center"
android:singleLine="false"
android:text='@{appName}'
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="?android:attr/textColorPrimary"
android:textSize="20sp"
tools:text="@tools:sample/lorem" />
</LinearLayout>
</RelativeLayout>
<androidx.fragment.app.FragmentContainerView
android:id="@+id/sub_preferences"
android:name="org.microg.gms.ui.PushNotificationAppPreferencesFragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout>
</layout>

View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ SPDX-FileCopyrightText: 2020, microG Project Team
~ SPDX-License-Identifier: Apache-2.0
-->
<layout 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">
<data>
<variable
name="gcmEnabled"
type="boolean" />
<variable
name="checkinEnabled"
type="boolean" />
<variable
name="switchBarCallback"
type="org.microg.gms.ui.PreferenceSwitchBarCallback" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
layout="@layout/preference_switch_bar"
app:callback="@{switchBarCallback}"
app:checked="@{gcmEnabled}"
app:description='@{"Receive push notifications"}'
app:enabled="@{checkinEnabled}" />
<androidx.fragment.app.FragmentContainerView
android:id="@+id/sub_preferences"
android:name="org.microg.gms.ui.PushNotificationPreferencesFragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout>
</layout>