uidView = new WeakReference<>(null);
22 | String uid = "";
23 |
24 | public CustomPreference(Context context, AttributeSet attrs) {
25 | super(context, attrs);
26 | setLayoutResource(R.layout.copy_uid_preference);
27 | }
28 |
29 | @Override
30 | public void onBindViewHolder(PreferenceViewHolder holder) {
31 | super.onBindViewHolder(holder);
32 | TextView textViewUID = (TextView) holder.findViewById(R.id.preference_uid);
33 | uidView = new WeakReference<>(textViewUID);
34 | if (uidView.get() != null)
35 | uidView.get().setText(uid);
36 |
37 | ImageView imageView = (ImageView) holder.findViewById(R.id.preference_icon);
38 | imageView.setImageResource(com.nextgis.maplibui.R.drawable.ic_action_content_copy);
39 |
40 | imageView.setOnClickListener(v -> {
41 | final ClipboardManager clipboard = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
42 | final ClipData clip = ClipData.newPlainText("uid", uid);
43 | clipboard.setPrimaryClip(clip);
44 | Toast.makeText(getContext(), R.string.copied, Toast.LENGTH_LONG).show();
45 | });
46 | }
47 |
48 | @Override
49 | public void setLayoutResource(int layoutResId) {
50 | super.setLayoutResource(layoutResId);
51 | }
52 |
53 |
54 |
55 | public void setUID(final String uid){
56 | this.uid = uid;
57 | if (uidView.get() != null)
58 | uidView.get().setText(uid);
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/app/src/main/java/com/nextgis/mobile/util/IntEditTextPreference.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Project: NextGIS Mobile
3 | * Purpose: Mobile GIS for Android.
4 | * Author: NikitaFeodonit, nfeodonit@yandex.com
5 | * Author: Stanislav Petriakov, becomeglory@gmail.com
6 | * *****************************************************************************
7 | * Copyright (c) 2016-2017, 2019 NextGIS, info@nextgis.com
8 | *
9 | * This program is free software: you can redistribute it and/or modify
10 | * it under the terms of the GNU General Public License as published by
11 | * the Free Software Foundation, either version 3 of the License, or
12 | * (at your option) any later version.
13 | *
14 | * This program is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU General Public License
20 | * along with this program. If not, see .
21 | */
22 |
23 | package com.nextgis.mobile.util;
24 |
25 | import android.content.Context;
26 | import androidx.preference.EditTextPreference;
27 | import android.util.AttributeSet;
28 |
29 | public class IntEditTextPreference extends EditTextPreference
30 | {
31 | public IntEditTextPreference(Context context) {
32 | super(context);
33 | }
34 |
35 | public IntEditTextPreference(Context context, AttributeSet attrs) {
36 | super(context, attrs);
37 | }
38 |
39 | public IntEditTextPreference(Context context, AttributeSet attrs, int defStyle) {
40 | super(context, attrs, defStyle);
41 | }
42 |
43 | public IntEditTextPreference(
44 | Context context,
45 | AttributeSet attrs,
46 | int defStyleAttr,
47 | int defStyleRes)
48 | {
49 | super(context, attrs, defStyleAttr, defStyleRes);
50 | }
51 |
52 | @Override
53 | public String getPersistedString(String defaultReturnValue) {
54 | int def = -1;
55 | try {
56 | def = Integer.parseInt(defaultReturnValue);
57 | } catch (Exception ignored) {}
58 | return String.valueOf(getPersistedInt(def));
59 | }
60 |
61 | @Override
62 | public boolean persistString(String value) {
63 | return persistInt(Integer.valueOf(value));
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/app/src/main/java/com/nextgis/mobile/util/Logger.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Project: NextGIS Mobile
3 | * Purpose: Mobile GIS for Android.
4 | * Author: Stanislav Petriakov, becomeglory@gmail.com
5 | * ****************************************************************************
6 | * Copyright (c) 2021 NextGIS, info@nextgis.com
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | package com.nextgis.mobile.util;
23 |
24 | import android.content.Context;
25 | import android.util.Log;
26 |
27 | import com.hypertrack.hyperlog.HyperLog;
28 |
29 | public final class Logger {
30 | public static void initialize(Context context) {
31 | HyperLog.initialize(context);
32 | HyperLog.setLogLevel(Log.VERBOSE);
33 | HyperLog.setLogFormat(new CustomLogMessageFormat(context));
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/src/main/java/com/nextgis/mobile/util/OfflineSyncIntentService.java:
--------------------------------------------------------------------------------
1 | package com.nextgis.mobile.util;
2 |
3 | import android.accounts.Account;
4 | import android.accounts.AccountManager;
5 | import android.app.IntentService;
6 | import android.content.Intent;
7 | import android.content.Context;
8 | import android.content.SyncResult;
9 |
10 | import com.nextgis.maplib.api.IGISApplication;
11 | import com.nextgis.maplib.api.INGWLayer;
12 |
13 | import com.nextgis.maplib.map.MapContentProviderHelper;
14 | import com.nextgis.mobile.datasource.SyncAdapter;
15 |
16 | import java.util.ArrayList;
17 | import java.util.List;
18 |
19 | /**
20 | * An {@link IntentService} subclass for handling asynchronous task requests in
21 | * a service on a separate handler thread.
22 | *
23 | *
24 | * TODO: Customize class - update intent actions, extra parameters and static
25 | * helper methods.
26 | */
27 | public class OfflineSyncIntentService extends IntentService {
28 |
29 | private static final String ACTION_OFFSYNC = "com.nextgis.mobile.util.action.OFFSYNC";
30 |
31 | public OfflineSyncIntentService() {
32 | super("OfflineSyncIntentService");
33 | }
34 |
35 | public static void startActionFoo(Context context) {
36 | Intent intent = new Intent(context, OfflineSyncIntentService.class);
37 | intent.setAction(ACTION_OFFSYNC);
38 | context.startService(intent);
39 | }
40 |
41 | @Override
42 | protected void onHandleIntent(Intent intent) {
43 | if (intent != null) {
44 | final String action = intent.getAction();
45 | if (ACTION_OFFSYNC.equals(action)) {
46 | handleActionFoo();
47 | }
48 | }
49 | }
50 |
51 | private void handleActionFoo() {
52 |
53 | List mAccounts = new ArrayList<>();
54 | final AccountManager accountManager = AccountManager.get(getApplicationContext());
55 | final IGISApplication application = (IGISApplication) getApplication();
56 | List layers = new ArrayList<>();
57 |
58 | for (Account account : accountManager.getAccountsByType(application.getAccountsType())) {
59 | layers.clear();
60 | MapContentProviderHelper.getLayersByAccount(application.getMap(), account.name, layers);
61 |
62 | if (layers.size() > 0 )
63 | mAccounts.add(account);
64 | }
65 |
66 | SyncResult syncResult = new SyncResult();
67 |
68 | SyncAdapter syncAdapter = new SyncAdapter(getApplicationContext(), true);
69 |
70 |
71 | for (Account account : mAccounts){
72 | syncAdapter.onPerformSync(account, null, com.nextgis.mobile.util.AppSettingsConstants.AUTHORITY,
73 | null, syncResult);
74 | }
75 | }
76 |
77 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/nextgis/mobile/util/SDCardReceiver.java:
--------------------------------------------------------------------------------
1 | package com.nextgis.mobile.util;
2 |
3 | import android.app.AlertDialog;
4 | import android.content.BroadcastReceiver;
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import android.content.IntentFilter;
8 | import android.os.Environment;
9 | import android.os.Handler;
10 |
11 | import com.nextgis.mobile.activity.MainActivity;
12 |
13 | public class SDCardReceiver extends BroadcastReceiver {
14 | @Override
15 | public void onReceive(Context context, Intent intent) {
16 | String action = intent.getAction();
17 |
18 | String nameSD = intent.getData().getPath();
19 | if (action.equals(Intent.ACTION_MEDIA_EJECT)) {
20 | AlertDialog.Builder builder = new AlertDialog.Builder(context);
21 | builder.setMessage("Карточку вытащили")
22 | .setPositiveButton("ok", null)
23 | .setTitle("SD Card");
24 | AlertDialog alertDialog=builder.create();
25 | alertDialog.show();
26 | // SD card has been removed
27 | } else if (action.equals(Intent.ACTION_MEDIA_MOUNTED)) {
28 | // SD card has been mounted
29 | }
30 | }
31 |
32 | // public void registerReceiver(Context context) {
33 | // IntentFilter filter = new IntentFilter();
34 | // filter.addAction(Intent.ACTION_MEDIA_EJECT);
35 | // filter.addAction(Intent.ACTION_MEDIA_MOUNTED);
36 | // filter.addDataScheme("file");
37 | // context.registerReceiver(this, filter );
38 | // }
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/java/com/nextgis/mobile/util/SDCardUtils.java:
--------------------------------------------------------------------------------
1 | package com.nextgis.mobile.util;
2 |
3 | import static com.nextgis.maplib.util.SettingsConstants.KEY_PREF_SD_CARD_NAME;
4 |
5 | import android.content.Context;
6 | import android.content.SharedPreferences;
7 | import android.preference.PreferenceManager;
8 | import android.text.TextUtils;
9 |
10 | import androidx.core.content.ContextCompat;
11 |
12 | import java.io.File;
13 |
14 | public class SDCardUtils{
15 | public static boolean isSDCardUsedAndExtracted(Context context){
16 |
17 | SharedPreferences mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
18 | String sdCardName = mSharedPreferences.getString(KEY_PREF_SD_CARD_NAME, "");
19 |
20 | if (!TextUtils.isEmpty(sdCardName)){
21 | // sd card used
22 | boolean sdStillExists = false;
23 | File[] files = ContextCompat.getExternalFilesDirs(context, null);
24 | for (File file : files){
25 | if (file != null && file.getAbsolutePath().contains(sdCardName))
26 | sdStillExists = true;
27 |
28 | }
29 | if (!sdStillExists)
30 | return true;
31 | }
32 | return false;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/drawer_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-hdpi/drawer_shadow.9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/fab_bg_mini.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-hdpi/fab_bg_mini.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/fab_bg_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-hdpi/fab_bg_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_add_layer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-hdpi/ic_action_add_layer.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_location_found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-hdpi/ic_action_location_found.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_maps_place.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-hdpi/ic_action_maps_place.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_sync.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-hdpi/ic_action_sync.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_drawer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-hdpi/ic_drawer.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_ruler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-hdpi/ic_ruler.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/drawer_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-mdpi/drawer_shadow.9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/fab_bg_mini.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-mdpi/fab_bg_mini.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/fab_bg_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-mdpi/fab_bg_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_add_layer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-mdpi/ic_action_add_layer.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_location_found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-mdpi/ic_action_location_found.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_maps_place.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-mdpi/ic_action_maps_place.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_sync.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-mdpi/ic_action_sync.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_drawer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-mdpi/ic_drawer.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_ruler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-mdpi/ic_ruler.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/drawer_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xhdpi/drawer_shadow.9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/fab_bg_mini.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xhdpi/fab_bg_mini.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/fab_bg_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xhdpi/fab_bg_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_add_layer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xhdpi/ic_action_add_layer.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_location_found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xhdpi/ic_action_location_found.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_maps_place.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xhdpi/ic_action_maps_place.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_sync.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xhdpi/ic_action_sync.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_drawer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xhdpi/ic_drawer.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_ruler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xhdpi/ic_ruler.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/drawer_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xxhdpi/drawer_shadow.9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/fab_bg_mini.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xxhdpi/fab_bg_mini.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/fab_bg_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xxhdpi/fab_bg_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_add_layer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xxhdpi/ic_action_add_layer.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_location_found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xxhdpi/ic_action_location_found.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_maps_place.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xxhdpi/ic_action_maps_place.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_sync.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xxhdpi/ic_action_sync.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_drawer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xxhdpi/ic_drawer.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_ruler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xxhdpi/ic_ruler.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/fab_bg_mini.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xxxhdpi/fab_bg_mini.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/fab_bg_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xxxhdpi/fab_bg_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_ruler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable-xxxhdpi/ic_ruler.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/intro.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable/intro.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/intro_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/drawable/intro_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/message_box.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/point_blue.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/point_indigo.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/point_red.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/point_yellow.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout-land/fragment_intro1.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
32 |
33 |
37 |
38 |
46 |
47 |
54 |
55 |
56 |
60 |
61 |
66 |
67 |
72 |
77 |
78 |
83 |
84 |
85 |
86 |
91 |
92 |
97 |
98 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/app/src/main/res/layout-land/status_panel.xml:
--------------------------------------------------------------------------------
1 |
2 |
24 |
25 |
31 |
32 |
39 |
40 |
44 |
45 |
49 |
50 |
54 |
55 |
59 |
60 |
66 |
67 |
73 |
74 |
80 |
81 |
82 |
88 |
89 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
28 |
29 |
33 |
34 |
38 |
39 |
48 |
49 |
56 |
57 |
58 |
64 |
65 |
75 |
76 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_intro.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
29 |
30 |
35 |
36 |
41 |
42 |
48 |
49 |
58 |
59 |
63 |
64 |
73 |
74 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
23 |
24 |
25 |
32 |
33 |
37 |
41 |
42 |
49 |
50 |
52 |
53 |
55 |
56 |
57 |
67 |
68 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_new_layer.xml:
--------------------------------------------------------------------------------
1 |
21 |
22 |
26 |
27 |
28 |
29 |
35 |
36 |
42 |
43 |
48 |
49 |
55 |
56 |
62 |
63 |
68 |
69 |
76 |
77 |
86 |
87 |
88 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/copy_uid_preference.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
20 |
21 |
29 |
30 |
31 |
32 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_new_field.xml:
--------------------------------------------------------------------------------
1 |
21 |
22 |
28 |
29 |
35 |
36 |
41 |
42 |
49 |
50 |
56 |
57 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_attributes.xml:
--------------------------------------------------------------------------------
1 |
23 |
24 |
29 |
30 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_attributes_tab.xml:
--------------------------------------------------------------------------------
1 |
23 |
24 |
30 |
31 |
40 |
41 |
45 |
46 |
53 |
54 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_compass_full.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
30 |
31 |
36 |
37 |
44 |
45 |
57 |
58 |
66 |
67 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_intro1.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
32 |
33 |
37 |
38 |
46 |
47 |
54 |
55 |
56 |
60 |
61 |
66 |
67 |
72 |
73 |
78 |
79 |
84 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_intro2.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
32 |
33 |
42 |
43 |
48 |
49 |
54 |
55 |
60 |
61 |
66 |
67 |
71 |
72 |
80 |
81 |
90 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_intro_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
30 |
31 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_layers.xml:
--------------------------------------------------------------------------------
1 |
23 |
24 |
29 |
30 |
37 |
38 |
46 |
47 |
54 |
55 |
62 |
63 |
64 |
65 |
72 |
73 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_field.xml:
--------------------------------------------------------------------------------
1 |
21 |
22 |
29 |
30 |
35 |
36 |
42 |
43 |
49 |
50 |
51 |
52 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_refresh.xml:
--------------------------------------------------------------------------------
1 |
2 |
24 |
25 |
28 |
29 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/status_panel_land.xml:
--------------------------------------------------------------------------------
1 |
2 |
24 |
25 |
31 |
32 |
39 |
40 |
44 |
45 |
49 |
50 |
54 |
55 |
61 |
62 |
68 |
69 |
75 |
76 |
77 |
83 |
84 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/add_layer.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/attributes.xml:
--------------------------------------------------------------------------------
1 |
2 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
23 |
24 |
74 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/select_action.xml:
--------------------------------------------------------------------------------
1 |
2 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_location_moving.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/mipmap-hdpi/ic_location_moving.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_location_standing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/mipmap-hdpi/ic_location_standing.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_location_moving.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/mipmap-mdpi/ic_location_moving.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_location_standing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/mipmap-mdpi/ic_location_standing.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_location_moving.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/mipmap-xhdpi/ic_location_moving.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_location_standing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/mipmap-xhdpi/ic_location_standing.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_location_moving.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/mipmap-xxhdpi/ic_location_moving.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_location_standing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/mipmap-xxhdpi/ic_location_standing.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_location_moving.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/mipmap-xxxhdpi/ic_location_moving.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_location_standing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/mipmap-xxxhdpi/ic_location_standing.png
--------------------------------------------------------------------------------
/app/src/main/res/raw/mapnik.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/app/src/main/res/raw/mapnik.zip
--------------------------------------------------------------------------------
/app/src/main/res/values-large/layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
24 |
25 |
26 | - @layout/fragment_map_tab
28 |
29 | true
30 |
--------------------------------------------------------------------------------
/app/src/main/res/values-sw600dp/layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
24 |
25 |
26 | - @layout/fragment_map_tab
28 |
29 | true
30 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
23 |
24 |
25 |
28 | 64dp
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
24 |
25 |
26 |
27 | - 1
28 | - 2
29 | - 3
30 |
31 |
32 | - light
33 | - neutral
34 | - dark
35 |
36 |
37 | - @string/map_bg_light
38 | - @string/map_bg_neutral
39 | - @string/map_bg_dark
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
24 |
25 |
26 | false
27 |
28 |
30 |
32 |
34 |
36 |
38 |
40 |
42 |
43 |
45 |
47 |
48 |
49 |
51 |
52 |
53 |
55 |
57 |
59 |
61 |
63 |
64 |
66 |
68 |
70 |
72 |
74 |
76 |
78 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
24 | #FFE81E
25 | #9900CF
26 | #073F9E
27 | #FF5A58
28 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
23 |
24 |
25 |
26 | 16dp
27 | 16dp
28 |
29 |
31 | 304dp
32 |
33 | 56dp
34 | 40dp
35 |
36 | 24dp
37 |
38 | 14dp
39 | 2dp
40 |
41 | 3dp
42 | 9dp
43 |
44 | 1dp
45 |
46 | 16dp
47 | 8dp
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
24 |
25 |
26 |
28 |
30 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
23 |
24 |
25 |
26 |
30 |
32 |
33 |
35 |
36 |
40 |
41 |
44 |
45 |
56 |
57 |
61 |
62 |
70 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/app_tracker.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
25 |
26 | UA-89437449-1
27 | verbose
28 | true
29 | true
30 |
31 | Main Screen
32 | Support Screen
33 | Create Empty Vector Layer Screen
34 | Settings Screen
35 | Compass Screen
36 | Attributes Screen
37 | Attributes Table Screen
38 | FB Modify Screen
39 | Modify Screen
40 | NGW Settings Screen
41 | NGW Login Screen
42 | NGW Select Resource Screen
43 | TMS Settings Screen
44 | Vector Settings Screen
45 | My Tracks Screen
46 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/preference_headers.xml:
--------------------------------------------------------------------------------
1 |
2 |
24 |
25 |
31 |
32 |
37 |
38 |
39 |
40 |
41 |
46 |
47 |
48 |
49 |
50 |
55 |
56 |
57 |
58 |
59 |
64 |
65 |
66 |
67 |
68 |
73 |
74 |
75 |
76 |
77 |
82 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/preferences_location.xml:
--------------------------------------------------------------------------------
1 |
23 |
24 |
28 |
36 |
37 |
46 |
47 |
56 |
57 |
65 |
66 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/preferences_tracks.xml:
--------------------------------------------------------------------------------
1 |
23 |
24 |
29 |
30 |
38 |
39 |
49 |
50 |
60 |
61 |
68 |
69 |
78 |
79 |
80 |
87 |
88 |
89 |
93 |
94 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/syncadapter.xml:
--------------------------------------------------------------------------------
1 |
2 |
24 |
25 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/art/NextGIS-Mobile-eng.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/art/NextGIS-Mobile-eng.png
--------------------------------------------------------------------------------
/art/add_point.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/art/appIcon.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/art/delete_point.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/art/nextgis-mobile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/art/nextgis-mobile.png
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Project: NextGIS Mobile
3 | * Purpose: Mobile GIS for Android.
4 | * Author: Dmitry Baryshnikov (aka Bishop), bishop.dev@gmail.com
5 | * Author: NikitaFeodonit, nfeodonit@yandex.com
6 | * Author: Stanislav Petriakov, becomeglory@gmail.com
7 | * *****************************************************************************
8 | * Copyright (c) 2014-2019 NextGIS, info@nextgis.com
9 | *
10 | * This program is free software: you can redistribute it and/or modify
11 | * it under the terms of the GNU General Public License as published by
12 | * the Free Software Foundation, either version 3 of the License, or
13 | * (at your option) any later version.
14 | *
15 | * This program is distributed in the hope that it will be useful,
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | * GNU General Public License for more details.
19 | *
20 | * You should have received a copy of the GNU General Public License
21 | * along with this program. If not, see .
22 | */
23 |
24 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
25 |
26 | buildscript {
27 | ext.kotlin_version = '1.9.20'
28 |
29 | repositories {
30 | maven {
31 | url 'https://maven.google.com/'
32 | name 'Google'
33 | }
34 | google()
35 | mavenCentral()
36 | maven { url 'https://jitpack.io' }
37 | }
38 | dependencies {
39 | classpath 'com.android.tools.build:gradle:8.4.2'
40 | classpath 'com.google.gms:google-services:4.4.2'
41 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
42 | classpath 'io.sentry:sentry-android-gradle-plugin:3.6.0'
43 |
44 | // NOTE: Do not place your application dependencies here; they belong
45 | // in the individual module build.gradle files
46 | }
47 | }
48 |
49 | allprojects {
50 | repositories {
51 | mavenCentral()
52 | maven { url "https://www.jitpack.io" }
53 | google()
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Project: NextGIS Mobile
3 | # Purpose: Mobile GIS for Android.
4 | # Author: Dmitry Baryshnikov (aka Bishop), bishop.dev@gmail.com
5 | # Author: NikitaFeodonit, nfeodonit@yandex.com
6 | # Author: Stanislav Petriakov, becomeglory@gmail.com
7 | # ******************************************************************************
8 | # Copyright (c) 2012-2015. NextGIS, info@nextgis.com
9 | #
10 | # This program is free software: you can redistribute it and/or modify
11 | # it under the terms of the GNU General Public License as published by
12 | # the Free Software Foundation, either version 3 of the License, or
13 | # (at your option) any later version.
14 | #
15 | # This program is distributed in the hope that it will be useful,
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | # GNU General Public License for more details.
19 | #
20 | # You should have received a copy of the GNU General Public License
21 | # along with this program. If not, see .
22 | #
23 |
24 | # Project-wide Gradle settings.
25 |
26 | # IDE (e.g. Android Studio) users:
27 | # Gradle settings configured through the IDE *will override*
28 | # any settings specified in this file.
29 |
30 | # For more details on how to configure your build environment visit
31 | # http://www.gradle.org/docs/current/userguide/build_environment.html
32 |
33 | # Specifies the JVM arguments used for the daemon process.
34 | # The setting is particularly useful for tweaking memory settings.
35 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
36 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
37 |
38 | # When configured, Gradle will run in incubating parallel mode.
39 | # This option should only be used with decoupled projects. More details, visit
40 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
41 | # org.gradle.parallel=true
42 | android.enableJetifier=true
43 | android.useAndroidX=true
44 | android.nonFinalResIds=false
45 | enableOnBackInvokedCallback=true
46 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Sep 23 15:00:42 VLAT 2024
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Project: NextGIS Mobile
3 | * Purpose: Mobile GIS for Android.
4 | * Author: Dmitry Baryshnikov (aka Bishop), bishop.dev@gmail.com
5 | * Author: NikitaFeodonit, nfeodonit@yandex.com
6 | * Author: Stanislav Petriakov, becomeglory@gmail.com
7 | * *****************************************************************************
8 | * Copyright (c) 2012-2015. NextGIS, info@nextgis.com
9 | *
10 | * This program is free software: you can redistribute it and/or modify
11 | * it under the terms of the GNU General Public License as published by
12 | * the Free Software Foundation, either version 3 of the License, or
13 | * (at your option) any later version.
14 | *
15 | * This program is distributed in the hope that it will be useful,
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | * GNU General Public License for more details.
19 | *
20 | * You should have received a copy of the GNU General Public License
21 | * along with this program. If not, see .
22 | */
23 |
24 | include ':app', ':maplib', ':maplibui'
25 | include ':wizardpager'
26 | include ':easypicker-module'
27 | project(':easypicker-module').projectDir = new File(rootDir, 'easypicker/easypicker')
--------------------------------------------------------------------------------
/wizardpager/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | namespace "com.tech.freak.wizardpager"
5 |
6 | defaultConfig {
7 | minSdkVersion 26
8 | compileSdk 34
9 | targetSdkVersion 34
10 | }
11 | compileOptions {
12 | sourceCompatibility JavaVersion.VERSION_16
13 | targetCompatibility JavaVersion.VERSION_16
14 | }
15 | }
16 |
17 | dependencies {
18 | // implementation( "androidx.legacy:legacy-support-v4:1.0.0")
19 | implementation 'androidx.appcompat:appcompat:1.7.0'
20 |
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/wizardpager/gradle.properties:
--------------------------------------------------------------------------------
1 | POM_NAME=Wizard Pager Library
2 | POM_ARTIFACT_ID=wizardpager
3 | POM_PACKAGING=aar
--------------------------------------------------------------------------------
/wizardpager/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/model/AbstractWizardModel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012 Roman Nurik
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.tech.freak.wizardpager.model;
18 |
19 | import android.content.Context;
20 | import android.os.Bundle;
21 |
22 | import java.util.ArrayList;
23 | import java.util.List;
24 |
25 | /**
26 | * Represents a wizard model, including the pages/steps in the wizard, their dependencies, and their
27 | * currently populated choices/values/selections.
28 | *
29 | * To create an actual wizard model, extend this class and implement {@link #onNewRootPageList()}.
30 | */
31 | public abstract class AbstractWizardModel implements ModelCallbacks {
32 | protected Context mContext;
33 |
34 | private List mListeners = new ArrayList();
35 | private PageList mRootPageList;
36 |
37 | public AbstractWizardModel(Context context) {
38 | mContext = context;
39 | mRootPageList = onNewRootPageList();
40 | }
41 |
42 | /**
43 | * Override this to define a new wizard model.
44 | */
45 | protected abstract PageList onNewRootPageList();
46 |
47 | @Override
48 | public void onPageDataChanged(Page page) {
49 | // can't use for each because of concurrent modification (review fragment
50 | // can get added or removed and will register itself as a listener)
51 | for (int i = 0; i < mListeners.size(); i++) {
52 | mListeners.get(i).onPageDataChanged(page);
53 | }
54 | }
55 |
56 | @Override
57 | public void onPageTreeChanged() {
58 | // can't use for each because of concurrent modification (review fragment
59 | // can get added or removed and will register itself as a listener)
60 | for (int i = 0; i < mListeners.size(); i++) {
61 | mListeners.get(i).onPageTreeChanged();
62 | }
63 | }
64 |
65 | public Page findByKey(String key) {
66 | return mRootPageList.findByKey(key);
67 | }
68 |
69 | public void load(Bundle savedValues) {
70 | for (String key : savedValues.keySet()) {
71 | mRootPageList.findByKey(key).resetData(savedValues.getBundle(key));
72 | }
73 | }
74 |
75 | public void registerListener(ModelCallbacks listener) {
76 | mListeners.add(listener);
77 | }
78 |
79 | public Bundle save() {
80 | Bundle bundle = new Bundle();
81 | for (Page page : getCurrentPageSequence()) {
82 | bundle.putBundle(page.getKey(), page.getData());
83 | }
84 | return bundle;
85 | }
86 |
87 | /**
88 | * Gets the current list of wizard steps, flattening nested (dependent) pages based on the
89 | * user's choices.
90 | */
91 | public List getCurrentPageSequence() {
92 | ArrayList flattened = new ArrayList();
93 | mRootPageList.flattenCurrentPageSequence(flattened);
94 | return flattened;
95 | }
96 |
97 | public void unregisterListener(ModelCallbacks listener) {
98 | mListeners.remove(listener);
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/model/BranchPage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012 Roman Nurik
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.tech.freak.wizardpager.model;
18 |
19 | import java.util.ArrayList;
20 | import java.util.List;
21 |
22 | import androidx.fragment.app.Fragment;
23 | import android.text.TextUtils;
24 | import com.tech.freak.wizardpager.ui.SingleChoiceFragment;
25 |
26 | /**
27 | * A page representing a branching point in the wizard. Depending on which choice is selected, the
28 | * next set of steps in the wizard may change.
29 | */
30 | public class BranchPage extends SingleFixedChoicePage {
31 | private List mBranches = new ArrayList();
32 |
33 | public BranchPage(ModelCallbacks callbacks, String title) {
34 | super(callbacks, title);
35 | }
36 |
37 | @Override
38 | public Page findByKey(String key) {
39 | if (getKey().equals(key)) {
40 | return this;
41 | }
42 |
43 | for (Branch branch : mBranches) {
44 | Page found = branch.childPageList.findByKey(key);
45 | if (found != null) {
46 | return found;
47 | }
48 | }
49 |
50 | return null;
51 | }
52 |
53 | @Override
54 | public void flattenCurrentPageSequence(ArrayList destination) {
55 | super.flattenCurrentPageSequence(destination);
56 | for (Branch branch : mBranches) {
57 | if (branch.choice.equals(mData.getString(Page.SIMPLE_DATA_KEY))) {
58 | branch.childPageList.flattenCurrentPageSequence(destination);
59 | break;
60 | }
61 | }
62 | }
63 |
64 | public BranchPage addBranch(String choice, Page... childPages) {
65 | PageList childPageList = new PageList(childPages);
66 | for (Page page : childPageList) {
67 | page.setParentKey(choice);
68 | }
69 | mBranches.add(new Branch(choice, childPageList));
70 | return this;
71 | }
72 |
73 | @Override
74 | public Fragment createFragment() {
75 | return SingleChoiceFragment.create(getKey());
76 | }
77 |
78 | public String getOptionAt(int position) {
79 | return mBranches.get(position).choice;
80 | }
81 |
82 | public int getOptionCount() {
83 | return mBranches.size();
84 | }
85 |
86 | @Override
87 | public void getReviewItems(ArrayList dest) {
88 | dest.add(new ReviewItem(getTitle(), mData.getString(SIMPLE_DATA_KEY), getKey()));
89 | }
90 |
91 | @Override
92 | public boolean isCompleted() {
93 | return !TextUtils.isEmpty(mData.getString(SIMPLE_DATA_KEY));
94 | }
95 |
96 | @Override
97 | public void notifyDataChanged() {
98 | mCallbacks.onPageTreeChanged();
99 | super.notifyDataChanged();
100 | }
101 |
102 | public BranchPage setValue(String value) {
103 | mData.putString(SIMPLE_DATA_KEY, value);
104 | return this;
105 | }
106 |
107 | private static class Branch {
108 | public String choice;
109 | public PageList childPageList;
110 |
111 | private Branch(String choice, PageList childPageList) {
112 | this.choice = choice;
113 | this.childPageList = childPageList;
114 | }
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/model/GeoPage.java:
--------------------------------------------------------------------------------
1 | package com.tech.freak.wizardpager.model;
2 |
3 | import androidx.fragment.app.Fragment;
4 | import com.tech.freak.wizardpager.ui.GeoFragment;
5 |
6 | public class GeoPage extends TextPage {
7 |
8 | public GeoPage(ModelCallbacks callbacks, String title) {
9 | super(callbacks, title);
10 | }
11 |
12 | @Override
13 | public Fragment createFragment() {
14 | return GeoFragment.create(getKey());
15 | }
16 |
17 | public GeoPage setValue(String value) {
18 | mData.putString(SIMPLE_DATA_KEY, value);
19 | return this;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/model/ImagePage.java:
--------------------------------------------------------------------------------
1 | package com.tech.freak.wizardpager.model;
2 |
3 | import androidx.fragment.app.Fragment;
4 | import com.tech.freak.wizardpager.ui.ImageFragment;
5 |
6 | public class ImagePage extends TextPage {
7 |
8 | public ImagePage(ModelCallbacks callbacks, String title) {
9 | super(callbacks, title);
10 | }
11 |
12 | @Override
13 | public Fragment createFragment() {
14 | return ImageFragment.create(getKey());
15 | }
16 |
17 | public ImagePage setValue(String value) {
18 | mData.putString(SIMPLE_DATA_KEY, value);
19 | return this;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/model/ModelCallbacks.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012 Roman Nurik
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.tech.freak.wizardpager.model;
18 |
19 | /**
20 | * Callback interface connecting {@link Page}, {@link AbstractWizardModel}, and model container
21 | * objects (e.g. {@link com.example.android.wizardpager.MainActivity}.
22 | */
23 | public interface ModelCallbacks {
24 | void onPageDataChanged(Page page);
25 | void onPageTreeChanged();
26 | }
27 |
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/model/MultipleFixedChoicePage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012 Roman Nurik
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.tech.freak.wizardpager.model;
18 |
19 | import java.util.ArrayList;
20 |
21 | import androidx.fragment.app.Fragment;
22 | import com.tech.freak.wizardpager.ui.MultipleChoiceFragment;
23 |
24 | /**
25 | * A page offering the user a number of non-mutually exclusive choices.
26 | */
27 | public class MultipleFixedChoicePage extends SingleFixedChoicePage {
28 | public MultipleFixedChoicePage(ModelCallbacks callbacks, String title) {
29 | super(callbacks, title);
30 | }
31 |
32 | @Override
33 | public Fragment createFragment() {
34 | return MultipleChoiceFragment.create(getKey());
35 | }
36 |
37 | @Override
38 | public void getReviewItems(ArrayList dest) {
39 | StringBuilder sb = new StringBuilder();
40 |
41 | ArrayList selections = mData.getStringArrayList(SIMPLE_DATA_KEY);
42 | if (selections != null && selections.size() > 0) {
43 | for (String selection : selections) {
44 | if (sb.length() > 0) {
45 | sb.append(", ");
46 | }
47 | sb.append(selection);
48 | }
49 | }
50 |
51 | dest.add(new ReviewItem(getTitle(), sb.toString(), getKey()));
52 | }
53 |
54 | @Override
55 | public boolean isCompleted() {
56 | ArrayList selections = mData.getStringArrayList(SIMPLE_DATA_KEY);
57 | return selections != null && selections.size() > 0;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/model/NumberPage.java:
--------------------------------------------------------------------------------
1 | package com.tech.freak.wizardpager.model;
2 |
3 | import androidx.fragment.app.Fragment;
4 | import com.tech.freak.wizardpager.ui.NumberFragment;
5 |
6 | public class NumberPage extends TextPage {
7 |
8 | public NumberPage(ModelCallbacks callbacks, String title) {
9 | super(callbacks, title);
10 | }
11 |
12 | @Override
13 | public Fragment createFragment() {
14 | return NumberFragment.create(getKey());
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/model/Page.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012 Roman Nurik
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.tech.freak.wizardpager.model;
18 |
19 | import android.os.Bundle;
20 |
21 | import androidx.fragment.app.Fragment;
22 |
23 | import java.util.ArrayList;
24 |
25 | /**
26 | * Represents a single page in the wizard.
27 | */
28 | public abstract class Page implements PageTreeNode {
29 | /**
30 | * The key into {@link #getData()} used for wizards with simple (single) values.
31 | */
32 | public static final String SIMPLE_DATA_KEY = "_";
33 |
34 | protected ModelCallbacks mCallbacks;
35 |
36 | /**
37 | * Current wizard values/selections.
38 | */
39 | protected Bundle mData = new Bundle();
40 | protected String mTitle;
41 | protected boolean mRequired = false;
42 | protected String mParentKey;
43 |
44 | protected Page(ModelCallbacks callbacks, String title) {
45 | mCallbacks = callbacks;
46 | mTitle = title;
47 | }
48 |
49 | public Bundle getData() {
50 | return mData;
51 | }
52 |
53 | public String getTitle() {
54 | return mTitle;
55 | }
56 |
57 | public boolean isRequired() {
58 | return mRequired;
59 | }
60 |
61 | void setParentKey(String parentKey) {
62 | mParentKey = parentKey;
63 | }
64 |
65 | @Override
66 | public Page findByKey(String key) {
67 | return getKey().equals(key) ? this : null;
68 | }
69 |
70 | @Override
71 | public void flattenCurrentPageSequence(ArrayList dest) {
72 | dest.add(this);
73 | }
74 |
75 | public abstract Fragment createFragment();
76 |
77 | public String getKey() {
78 | return (mParentKey != null) ? mParentKey + ":" + mTitle : mTitle;
79 | }
80 |
81 | public abstract void getReviewItems(ArrayList dest);
82 |
83 | public boolean isCompleted() {
84 | return true;
85 | }
86 |
87 | public void resetData(Bundle data) {
88 | mData = data;
89 | notifyDataChanged();
90 | }
91 |
92 | public void notifyDataChanged() {
93 | mCallbacks.onPageDataChanged(this);
94 | }
95 |
96 | public Page setRequired(boolean required) {
97 | mRequired = required;
98 | return this;
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/model/PageList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012 Roman Nurik
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.tech.freak.wizardpager.model;
18 |
19 | import java.util.ArrayList;
20 |
21 | /**
22 | * Represents a list of wizard pages.
23 | */
24 | public class PageList extends ArrayList implements PageTreeNode {
25 | /**
26 | *
27 | */
28 | private static final long serialVersionUID = -2829971774651385639L;
29 |
30 | public PageList(Page... pages) {
31 | for (Page page : pages) {
32 | add(page);
33 | }
34 | }
35 |
36 | @Override
37 | public Page findByKey(String key) {
38 | for (Page childPage : this) {
39 | Page found = childPage.findByKey(key);
40 | if (found != null) {
41 | return found;
42 | }
43 | }
44 |
45 | return null;
46 | }
47 |
48 | @Override
49 | public void flattenCurrentPageSequence(ArrayList dest) {
50 | for (Page childPage : this) {
51 | childPage.flattenCurrentPageSequence(dest);
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/model/PageTreeNode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012 Roman Nurik
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.tech.freak.wizardpager.model;
18 |
19 | import java.util.ArrayList;
20 |
21 | /**
22 | * Represents a node in the page tree. Can either be a single page, or a page container.
23 | */
24 | public interface PageTreeNode {
25 | public Page findByKey(String key);
26 | public void flattenCurrentPageSequence(ArrayList dest);
27 | }
28 |
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/model/ReviewItem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012 Roman Nurik
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.tech.freak.wizardpager.model;
18 |
19 | /**
20 | * Represents a single line item on the final review page.
21 | *
22 | * @see com.example.android.wizardpager.wizard.ui.ReviewFragment
23 | */
24 | public class ReviewItem {
25 | public static final int DEFAULT_WEIGHT = 0;
26 |
27 | private int mWeight;
28 | private String mTitle;
29 | private String mDisplayValue;
30 | private String mPageKey;
31 |
32 | public ReviewItem(String title, String displayValue, String pageKey) {
33 | this(title, displayValue, pageKey, DEFAULT_WEIGHT);
34 | }
35 |
36 | public ReviewItem(String title, String displayValue, String pageKey, int weight) {
37 | mTitle = title;
38 | mDisplayValue = displayValue;
39 | mPageKey = pageKey;
40 | mWeight = weight;
41 | }
42 |
43 | public String getDisplayValue() {
44 | return mDisplayValue;
45 | }
46 |
47 | public void setDisplayValue(String displayValue) {
48 | mDisplayValue = displayValue;
49 | }
50 |
51 | public String getPageKey() {
52 | return mPageKey;
53 | }
54 |
55 | public void setPageKey(String pageKey) {
56 | mPageKey = pageKey;
57 | }
58 |
59 | public String getTitle() {
60 | return mTitle;
61 | }
62 |
63 | public void setTitle(String title) {
64 | mTitle = title;
65 | }
66 |
67 | public int getWeight() {
68 | return mWeight;
69 | }
70 |
71 | public void setWeight(int weight) {
72 | mWeight = weight;
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/model/SimpleLocationListener.java:
--------------------------------------------------------------------------------
1 | package com.tech.freak.wizardpager.model;
2 |
3 | import android.location.Location;
4 |
5 | public interface SimpleLocationListener {
6 | public void onLocationChanged(Location location);
7 | }
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/model/SingleFixedChoicePage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012 Roman Nurik
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.tech.freak.wizardpager.model;
18 |
19 | import java.util.ArrayList;
20 | import java.util.Arrays;
21 |
22 | import androidx.fragment.app.Fragment;
23 | import android.text.TextUtils;
24 | import com.tech.freak.wizardpager.ui.SingleChoiceFragment;
25 |
26 | /**
27 | * A page offering the user a number of mutually exclusive choices.
28 | */
29 | public class SingleFixedChoicePage extends Page {
30 | protected ArrayList mChoices = new ArrayList();
31 |
32 | public SingleFixedChoicePage(ModelCallbacks callbacks, String title) {
33 | super(callbacks, title);
34 | }
35 |
36 | @Override
37 | public Fragment createFragment() {
38 | return SingleChoiceFragment.create(getKey());
39 | }
40 |
41 | public String getOptionAt(int position) {
42 | return mChoices.get(position);
43 | }
44 |
45 | public int getOptionCount() {
46 | return mChoices.size();
47 | }
48 |
49 | @Override
50 | public void getReviewItems(ArrayList dest) {
51 | dest.add(new ReviewItem(getTitle(), mData.getString(SIMPLE_DATA_KEY), getKey()));
52 | }
53 |
54 | @Override
55 | public boolean isCompleted() {
56 | return !TextUtils.isEmpty(mData.getString(SIMPLE_DATA_KEY));
57 | }
58 |
59 | public SingleFixedChoicePage setChoices(String... choices) {
60 | mChoices.addAll(Arrays.asList(choices));
61 | return this;
62 | }
63 |
64 | public SingleFixedChoicePage setValue(String value) {
65 | mData.putString(SIMPLE_DATA_KEY, value);
66 | return this;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/model/TextPage.java:
--------------------------------------------------------------------------------
1 | package com.tech.freak.wizardpager.model;
2 |
3 | import java.util.ArrayList;
4 |
5 | import androidx.fragment.app.Fragment;
6 | import android.text.TextUtils;
7 | import com.tech.freak.wizardpager.ui.TextFragment;
8 |
9 | public class TextPage extends Page {
10 |
11 | public TextPage(ModelCallbacks callbacks, String title) {
12 | super(callbacks, title);
13 | }
14 |
15 | @Override
16 | public Fragment createFragment() {
17 | return TextFragment.create(getKey());
18 | }
19 |
20 | @Override
21 | public void getReviewItems(ArrayList dest) {
22 | dest.add(new ReviewItem(getTitle(), mData.getString(SIMPLE_DATA_KEY),
23 | getKey()));
24 |
25 | }
26 |
27 | @Override
28 | public boolean isCompleted() {
29 | return !TextUtils.isEmpty(mData.getString(SIMPLE_DATA_KEY));
30 | }
31 |
32 | public TextPage setValue(String value) {
33 | mData.putString(SIMPLE_DATA_KEY, value);
34 | return this;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/ui/NumberFragment.java:
--------------------------------------------------------------------------------
1 | package com.tech.freak.wizardpager.ui;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.os.Build;
5 | import android.os.Bundle;
6 | import android.text.InputType;
7 |
8 | public class NumberFragment extends TextFragment {
9 | public static NumberFragment create(String key) {
10 | Bundle args = new Bundle();
11 | args.putString(ARG_KEY, key);
12 |
13 | NumberFragment f = new NumberFragment();
14 | f.setArguments(args);
15 | return f;
16 | }
17 |
18 | @SuppressLint("InlinedApi")
19 | @Override
20 | protected void setInputType() {
21 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
22 | mEditTextInput.setInputType(InputType.TYPE_CLASS_NUMBER);
23 | } else {
24 | mEditTextInput.setInputType(InputType.TYPE_CLASS_NUMBER
25 | | InputType.TYPE_NUMBER_VARIATION_NORMAL);
26 | }
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/ui/PageFragmentCallbacks.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012 Roman Nurik
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.tech.freak.wizardpager.ui;
18 |
19 | import com.tech.freak.wizardpager.model.Page;
20 |
21 | public interface PageFragmentCallbacks {
22 | Page onGetPage(String key);
23 | }
24 |
--------------------------------------------------------------------------------
/wizardpager/src/main/java/com/tech/freak/wizardpager/ui/TextFragment.java:
--------------------------------------------------------------------------------
1 | package com.tech.freak.wizardpager.ui;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.os.Bundle;
6 | import androidx.fragment.app.Fragment;
7 | import android.text.Editable;
8 | import android.text.InputType;
9 | import android.text.TextWatcher;
10 | import android.view.LayoutInflater;
11 | import android.view.View;
12 | import android.view.ViewGroup;
13 | import android.view.inputmethod.InputMethodManager;
14 | import android.widget.EditText;
15 | import android.widget.TextView;
16 | import com.tech.freak.wizardpager.R;
17 | import com.tech.freak.wizardpager.model.Page;
18 |
19 | public class TextFragment extends Fragment {
20 | protected static final String ARG_KEY = "key";
21 |
22 | private PageFragmentCallbacks mCallbacks;
23 | private String mKey;
24 | private Page mPage;
25 |
26 | protected EditText mEditTextInput;
27 |
28 | public static TextFragment create(String key) {
29 | Bundle args = new Bundle();
30 | args.putString(ARG_KEY, key);
31 |
32 | TextFragment f = new TextFragment();
33 | f.setArguments(args);
34 | return f;
35 | }
36 |
37 | @Override
38 | public void onCreate(Bundle savedInstanceState) {
39 | super.onCreate(savedInstanceState);
40 |
41 | Bundle args = getArguments();
42 | mKey = args.getString(ARG_KEY);
43 | mPage = mCallbacks.onGetPage(mKey);
44 | }
45 |
46 | @Override
47 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
48 | Bundle savedInstanceState) {
49 | View rootView = inflater.inflate(R.layout.fragment_page_text,
50 | container, false);
51 | ((TextView) rootView.findViewById(android.R.id.title)).setText(mPage
52 | .getTitle());
53 |
54 | mEditTextInput = (EditText) rootView.findViewById(R.id.editTextInput);
55 | mEditTextInput.setText(mPage.getData().getString(Page.SIMPLE_DATA_KEY));
56 | return rootView;
57 | }
58 |
59 | @Override
60 | public void onAttach(Activity activity) {
61 | super.onAttach(activity);
62 |
63 | if (!(activity instanceof PageFragmentCallbacks)) {
64 | throw new ClassCastException(
65 | "Activity must implement PageFragmentCallbacks");
66 | }
67 |
68 | mCallbacks = (PageFragmentCallbacks) activity;
69 | }
70 |
71 | @Override
72 | public void onDetach() {
73 | super.onDetach();
74 | mCallbacks = null;
75 | }
76 |
77 | @Override
78 | public void onViewCreated(View view, Bundle savedInstanceState) {
79 | super.onViewCreated(view, savedInstanceState);
80 | setInputType();
81 | mEditTextInput.addTextChangedListener(new TextWatcher() {
82 |
83 | @Override
84 | public void beforeTextChanged(CharSequence s, int start, int count,
85 | int after) {
86 | }
87 |
88 | @Override
89 | public void onTextChanged(CharSequence s, int start, int before,
90 | int count) {
91 | }
92 |
93 | @Override
94 | public void afterTextChanged(Editable editable) {
95 | mPage.getData().putString(Page.SIMPLE_DATA_KEY,
96 | (editable != null) ? editable.toString() : null);
97 | mPage.notifyDataChanged();
98 |
99 | }
100 |
101 | });
102 | }
103 |
104 | protected void setInputType() {
105 | mEditTextInput.setInputType(InputType.TYPE_CLASS_TEXT);
106 | }
107 |
108 | @Override
109 | public void setMenuVisibility(boolean menuVisible) {
110 | super.setMenuVisibility(menuVisible);
111 |
112 | // In a future update to the support library, this should override
113 | // setUserVisibleHint
114 | // instead of setMenuVisibility.
115 | if (mEditTextInput != null) {
116 | InputMethodManager imm = (InputMethodManager) getActivity()
117 | .getSystemService(Context.INPUT_METHOD_SERVICE);
118 | if (!menuVisible) {
119 | imm.hideSoftInputFromWindow(getView().getWindowToken(), 0);
120 | }
121 | }
122 | }
123 |
124 | }
125 |
--------------------------------------------------------------------------------
/wizardpager/src/main/res/drawable-hdpi/ic_person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/wizardpager/src/main/res/drawable-hdpi/ic_person.png
--------------------------------------------------------------------------------
/wizardpager/src/main/res/drawable-mdpi/ic_person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/wizardpager/src/main/res/drawable-mdpi/ic_person.png
--------------------------------------------------------------------------------
/wizardpager/src/main/res/drawable-xhdpi/ic_person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/wizardpager/src/main/res/drawable-xhdpi/ic_person.png
--------------------------------------------------------------------------------
/wizardpager/src/main/res/drawable-xxhdpi/ic_person.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nextgis/android_gisapp/56891264eb3aaf435b5d030988ec2ee932388b8d/wizardpager/src/main/res/drawable-xxhdpi/ic_person.png
--------------------------------------------------------------------------------
/wizardpager/src/main/res/layout/fragment_page.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
19 |
20 |
21 |
22 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/wizardpager/src/main/res/layout/fragment_page_geo.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
12 |
13 |
17 |
18 |
23 |
24 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/wizardpager/src/main/res/layout/fragment_page_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
13 |
14 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/wizardpager/src/main/res/layout/fragment_page_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/wizardpager/src/main/res/layout/list_item_review.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
27 |
28 |
37 |
38 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/wizardpager/src/main/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
--------------------------------------------------------------------------------
/wizardpager/src/main/res/values-v16/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
14 |
23 |
24 |
--------------------------------------------------------------------------------
/wizardpager/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 | #4433b5e5
19 | #ff0099cc
20 | #ff669900
21 | #10000000
22 |
23 | #ff669900
24 |
25 | #66000000
26 |
27 |
--------------------------------------------------------------------------------
/wizardpager/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 | 32dp
19 | 3dp
20 | 4dp
21 |
22 |
23 | 6dp
24 | 6dp
25 | 48dp
26 |
27 |
--------------------------------------------------------------------------------
/wizardpager/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Review
3 |
4 | Waiting GPS …
5 | Location found
6 | %1$s \n(%2$s)
7 |
8 |
9 | - Pick from gallery
10 | - Capture new photo
11 |
12 |
--------------------------------------------------------------------------------
/wizardpager/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
20 |
21 |
29 |
30 |
40 |
41 |
49 |
50 |
55 |
56 |
--------------------------------------------------------------------------------