Skip to content

Commit

Permalink
refactoring:android: Refactoreing to use androidx and targetapi 30 to…
Browse files Browse the repository at this point in the history
… be able to upload to google again.

See navit-gps#1173 and navit-gps#1171
  • Loading branch information
jkoan committed Jan 20, 2022
1 parent 17f1a6e commit 32f2bed
Show file tree
Hide file tree
Showing 18 changed files with 122 additions and 208 deletions.
29 changes: 11 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ apply plugin: 'checkstyle'

buildscript {
repositories {
mavenCentral()
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:7.0.4'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -21,12 +17,9 @@ buildscript {

allprojects {
repositories {
mavenCentral()
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}

}
}

Expand All @@ -36,8 +29,7 @@ task clean(type: Delete) {
}
*/
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
compileSdkVersion 31
signingConfigs {
release {
// We can leave these in environment variables
Expand All @@ -49,11 +41,11 @@ android {
}
defaultConfig {
applicationId "org.navitproject.navit"
minSdkVersion 10
targetSdkVersion 29
minSdkVersion 17
targetSdkVersion 30
versionCode gitVersionCode
versionName gitVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
ndk {
abiFilters 'x86', 'x86_64', 'arm64-v8a', 'armeabi-v7a'
}
Expand Down Expand Up @@ -135,10 +127,11 @@ android {
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'navit/android/libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.leanback:leanback:1.0.0'
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testImplementation 'junit:junit:4.12'
implementation 'ch.acra:acra:4.9.2'
// implementation 'com.android.support:support-v4:28.0.0'
}
153 changes: 0 additions & 153 deletions docs/development/android_development.rst

This file was deleted.

1 change: 1 addition & 0 deletions navit/android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@
<action android:name="ua.com.vassiliev.androidfilebrowser.SELECT_DIRECTORY_ACTION"></action>
</intent-filter>
</activity>
<activity android:name=".AppIntroFragment"></activity>
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:theme="@style/NavitTheme"
android:padding="3dp" >

<!--
Expand Down
5 changes: 3 additions & 2 deletions navit/android/res/values-v19/styles.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<resources>
<style name="NavitTheme" parent="android:Theme.DeviceDefault.NoActionBar">
<!-- API 19 theme customizations can go here. -->
<style name="NavitTheme" parent="@style/Theme.AppCompat.Light">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
</resources>
5 changes: 3 additions & 2 deletions navit/android/res/values-v21/styles.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<resources>
<style name="NavitTheme" parent="android:Theme.DeviceDefault.NoActionBar">
<!-- API 21 theme customizations can go here. -->
<style name="NavitTheme" parent="@style/Theme.AppCompat.Light">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
</resources>
4 changes: 4 additions & 0 deletions navit/android/src/org/navitproject/navit/AppIntro.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.navitproject.navit;

public class AppIntro {
}
43 changes: 43 additions & 0 deletions navit/android/src/org/navitproject/navit/AppIntroFragment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package org.navitproject.navit;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.Nullable;
import androidx.leanback.app.OnboardingSupportFragment;

public class AppIntroFragment extends OnboardingSupportFragment {
@Override
protected int getPageCount() {
return 0;
}

@Override
protected CharSequence getPageTitle(int pageIndex) {
return "Test1";
}

@Override
protected CharSequence getPageDescription(int pageIndex) {
return "bla blub";
}

@Nullable
@Override
protected View onCreateBackgroundView(LayoutInflater inflater, ViewGroup container) {
return null;
}

@Nullable
@Override
protected View onCreateContentView(LayoutInflater inflater, ViewGroup container) {
return null;
}

@Nullable
@Override
protected View onCreateForegroundView(LayoutInflater inflater, ViewGroup container) {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
// Project type now is Android library:
// http://developer.android.com/guide/developing/projects/projects-eclipse.html#ReferencingLibraryProject

import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
Expand All @@ -29,6 +28,8 @@
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList;
Expand All @@ -37,7 +38,7 @@
import java.util.List;


public class FileBrowserActivity extends Activity {
public class FileBrowserActivity extends AppCompatActivity {
// Intent Action Constants
public static final String INTENT_ACTION_SELECT_DIR = "ua.com.vassiliev.androidfilebrowser.SELECT_DIRECTORY_ACTION";
private static final String INTENT_ACTION_SELECT_FILE = "ua.com.vassiliev.androidfilebrowser.SELECT_FILE_ACTION";
Expand Down
Loading

0 comments on commit 32f2bed

Please sign in to comment.