Minor consistency fixes
This commit is contained in:
parent
7774cbb246
commit
dff6e1decd
9 changed files with 61 additions and 31 deletions
|
@ -4,6 +4,13 @@ plugins {
|
||||||
id 'com.android.library' version '7.2.1' apply false
|
id 'com.android.library' version '7.2.1' apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
project.ext {
|
||||||
|
minSdkVersion = 21
|
||||||
|
targetSdkVersion = 31
|
||||||
|
buildToolsVersion = '32.0.0'
|
||||||
|
javaVersion = JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
task clean(type: Delete) {
|
task clean(type: Delete) {
|
||||||
delete rootProject.buildDir
|
delete rootProject.buildDir
|
||||||
}
|
}
|
|
@ -3,13 +3,13 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk 32
|
compileSdk project.targetSdkVersion
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdk 21
|
minSdk project.minSdkVersion
|
||||||
targetSdk 32
|
targetSdk project.targetSdkVersion
|
||||||
|
buildToolsVersion project.buildToolsVersion
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
||||||
consumerProguardFiles "consumer-rules.pro"
|
consumerProguardFiles "consumer-rules.pro"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,8 +20,8 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility project.javaVersion
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility project.javaVersion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,12 +3,13 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk 32
|
compileSdk project.targetSdkVersion
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "app.organicmaps.api.sample.capitals"
|
applicationId "app.organicmaps.api.sample.capitals"
|
||||||
minSdk 21
|
minSdk project.minSdkVersion
|
||||||
targetSdk 32
|
targetSdk project.targetSdkVersion
|
||||||
|
buildToolsVersion project.buildToolsVersion
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
}
|
}
|
||||||
|
@ -20,13 +21,12 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility project.javaVersion
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility project.javaVersion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.4.2'
|
implementation 'androidx.appcompat:appcompat:1.4.2'
|
||||||
implementation 'com.google.android.material:material:1.6.1'
|
implementation 'com.google.android.material:material:1.6.1'
|
||||||
implementation project(path: ':lib')
|
implementation project(path: ':lib')
|
||||||
|
|
|
@ -65,9 +65,9 @@ public class CapitalsListActivity extends ListActivity
|
||||||
|
|
||||||
private void showCityOnOMMap(City ... cities)
|
private void showCityOnOMMap(City ... cities)
|
||||||
{
|
{
|
||||||
ArrayList<Point> points = new ArrayList<>(cities.length);
|
final ArrayList<Point> points = new ArrayList<>(cities.length);
|
||||||
for (int i = 0; i < cities.length; i++)
|
for (City city : cities)
|
||||||
points.add(cities[i].toPoint());
|
points.add(city.toPoint());
|
||||||
|
|
||||||
final String title = cities.length == 1 ? cities[0].getName() : "Capitals of the World";
|
final String title = cities.length == 1 ? cities[0].getName() : "Capitals of the World";
|
||||||
final Intent intent = new MapRequest()
|
final Intent intent = new MapRequest()
|
||||||
|
@ -84,7 +84,7 @@ public class CapitalsListActivity extends ListActivity
|
||||||
if (requestCode != REQ_CODE_CITY || resultCode != RESULT_OK)
|
if (requestCode != REQ_CODE_CITY || resultCode != RESULT_OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Intent intent = new Intent(this, CityDetailsActivity.class);
|
final Intent intent = new Intent(this, CityDetailsActivity.class);
|
||||||
intent.putExtra(CityDetailsActivity.EXTRA_POINT, data);
|
intent.putExtra(CityDetailsActivity.EXTRA_POINT, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,9 +55,8 @@ public class City
|
||||||
this.altNames = altNames;
|
this.altNames = altNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public String toString() { return name; }
|
||||||
public String toString() { return name; }
|
public Point toPoint() { return new Point(lat, lon, name, id); }
|
||||||
public Point toPoint() { return new Point(lat, lon, name, id); }
|
|
||||||
|
|
||||||
public String getId() { return id; }
|
public String getId() { return id; }
|
||||||
public String getName() { return name; }
|
public String getName() { return name; }
|
||||||
|
|
|
@ -92,13 +92,13 @@ public class CityDetailsActivity extends Activity
|
||||||
mAltNames.setText(mCity.getAltNames());
|
mAltNames.setText(mCity.getAltNames());
|
||||||
mCountry.setText(mCity.getCountryCode());
|
mCountry.setText(mCity.getCountryCode());
|
||||||
|
|
||||||
mLat.setText(mCity.getLat() + "");
|
mLat.setText(String.valueOf(mCity.getLat()));
|
||||||
mLon.setText(mCity.getLon() + "");
|
mLon.setText(String.valueOf(mCity.getLon()));
|
||||||
final String evel = mCity.getElevation() != -9999 ? String.valueOf(mCity.getElevation()) : "No Data";
|
final String level = mCity.getElevation() != -9999 ? String.valueOf(mCity.getElevation()) : "No Data";
|
||||||
mElev.setText(evel);
|
mElev.setText(level);
|
||||||
|
|
||||||
final String popul = mCity.getPopulation() != -1 ? String.valueOf(mCity.getPopulation()) : "No Data";
|
final String population = mCity.getPopulation() != -1 ? String.valueOf(mCity.getPopulation()) : "No Data";
|
||||||
mPopulation.setText(popul);
|
mPopulation.setText(population);
|
||||||
mTimeZone.setText(mCity.getTimeZone());
|
mTimeZone.setText(mCity.getTimeZone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +3,13 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk 32
|
compileSdk project.targetSdkVersion
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "app.organicmaps.api.sample.pick_point"
|
applicationId "app.organicmaps.api.sample.pick_point"
|
||||||
minSdk 21
|
minSdk project.minSdkVersion
|
||||||
targetSdk 32
|
targetSdk project.targetSdkVersion
|
||||||
|
buildToolsVersion project.buildToolsVersion
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
}
|
}
|
||||||
|
@ -20,8 +21,8 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility project.javaVersion
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility project.javaVersion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/******************************************************************************
|
||||||
|
Copyright (c) 2022, Organic Maps OÜ. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
Redistributions of source code must retain the above copyright notice, this list
|
||||||
|
of conditions and the following disclaimer. Redistributions in binary form must
|
||||||
|
reproduce the above copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided with the
|
||||||
|
distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||||
|
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||||
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||||
|
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||||
|
OF SUCH DAMAGE.
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
package app.organicmaps.api.sample.pick_point;
|
package app.organicmaps.api.sample.pick_point;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
|
|
@ -14,5 +14,5 @@ dependencyResolutionManagement {
|
||||||
}
|
}
|
||||||
rootProject.name = "Organic Maps API"
|
rootProject.name = "Organic Maps API"
|
||||||
include ':sample-app-capitals'
|
include ':sample-app-capitals'
|
||||||
include ':lib'
|
|
||||||
include ':sample-pick-point'
|
include ':sample-pick-point'
|
||||||
|
include ':lib'
|
||||||
|
|
Loading…
Add table
Reference in a new issue