Merge
This commit is contained in:
commit
689ad25b56
20 changed files with 610 additions and 130 deletions
|
@ -144,6 +144,7 @@
|
|||
<activity android:name="net.osmand.plus.activities.FavoritesListActivity" android:label="@string/favourites_list_activity" />
|
||||
<activity android:name="net.osmand.plus.activities.FavoritesActivity" android:windowSoftInputMode="adjustPan" />
|
||||
<activity android:name="net.osmand.plus.activities.PluginsActivity" />
|
||||
<activity android:name="net.osmand.plus.activities.PluginActivity" />
|
||||
<activity android:name="net.osmand.plus.activities.ContributionVersionActivity" android:configChanges="keyboardHidden|orientation" android:label="@string/contribution_activity" />
|
||||
|
||||
|
||||
|
|
89
OsmAnd/res/layout/plugin.xml
Normal file
89
OsmAnd/res/layout/plugin.xml
Normal file
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="?attr/actionBarSize">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activities.PluginActivity">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="144dp"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="66dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp">
|
||||
|
||||
<net.osmand.plus.widgets.ButtonEx
|
||||
android:id="@+id/plugin_settings"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="9dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:textSize="12sp"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:background="@null"
|
||||
android:drawableLeft="?attr/ic_action_settings"
|
||||
android:drawableStart="?attr/ic_action_settings"
|
||||
android:drawablePadding="10dp"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="16dp"
|
||||
android:text="@string/plugin_settings_button_caption"
|
||||
osmand:typeface="@string/font_roboto_medium"/>
|
||||
|
||||
<net.osmand.plus.widgets.SwitchEx
|
||||
android:id="@+id/plugin_enable_disable"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/switch_ex_background"
|
||||
android:minHeight="0dp"
|
||||
android:minWidth="0dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingLeft="9.5dp"
|
||||
android:paddingRight="9.5dp"
|
||||
android:paddingTop="8dp"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/switch_ex_text_color"
|
||||
android:textOff="@string/enable_plugin"
|
||||
android:textOn="@string/disable_plugin"
|
||||
android:textSize="12sp"
|
||||
osmand:typeface="@string/font_roboto_medium"/>
|
||||
</FrameLayout>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/plugin_description_title"
|
||||
android:textAllCaps="true"
|
||||
osmand:typeface="@string/font_roboto_medium"/>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/plugin_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="14dp"
|
||||
osmand:typeface="@string/font_roboto_regular"
|
||||
tools:text="@string/lorem_ipsum"/>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
|
@ -1886,4 +1886,6 @@
|
|||
<string name="remove_the_tag">Treure l\'etiqueta</string>
|
||||
<string name="enable_plugin">Activa</string>
|
||||
<string name="disable_plugin">Desactiva</string>
|
||||
<string name="plugin_description_title">Descripció</string>
|
||||
<string name="plugin_settings_button_caption">Configuració</string>
|
||||
</resources>
|
||||
|
|
|
@ -1902,4 +1902,6 @@
|
|||
<string name="remove_the_tag">FJERN MÆRKET</string>
|
||||
<string name="enable_plugin">Aktiver</string>
|
||||
<string name="disable_plugin">Deaktiver</string>
|
||||
<string name="plugin_description_title">Beskrivelse</string>
|
||||
<string name="plugin_settings_button_caption">Indstillinger</string>
|
||||
</resources>
|
||||
|
|
|
@ -2049,4 +2049,6 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an
|
|||
<string name="proxy_port_descr">Einen Proxy\'s Port einrichten (Bsp. 8118)</string>
|
||||
<string name="enable_plugin">Aktivieren</string>
|
||||
<string name="disable_plugin">Deaktivieren</string>
|
||||
</resources>
|
||||
<string name="plugin_description_title">Beschreibung</string>
|
||||
<string name="plugin_settings_button_caption">Einstellungen</string>
|
||||
</resources>
|
||||
|
|
|
@ -1920,4 +1920,6 @@ Afghanistan, Albanie, Algérie, Allemagne, Andorre, Angola, Anguilla, Antigua-et
|
|||
<string name="remove_the_tag">Retirer l\'étiquette</string>
|
||||
<string name="enable_plugin">Activer</string>
|
||||
<string name="disable_plugin">Désactiver</string>
|
||||
<string name="plugin_description_title">Description</string>
|
||||
<string name="plugin_settings_button_caption">Paramètres</string>
|
||||
</resources>
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
<attr name="ic_action_info2" format="reference" />
|
||||
<attr name="ic_action_home2" format="reference" />
|
||||
<attr name="ic_action_marker2" format="reference" />
|
||||
<attr name="search_background" format="reference" />
|
||||
<attr name="search_background" format="reference" />
|
||||
<attr name="ic_action_settings" format="reference" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="PagerSlidingTabStrip">
|
||||
|
|
|
@ -2086,4 +2086,6 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
|
|||
<string name="hide_all_waypoints">Remove all</string>
|
||||
<string name="enable_plugin">Enable</string>
|
||||
<string name="disable_plugin">Disable</string>
|
||||
<string name="plugin_description_title">Description</string>
|
||||
<string name="plugin_settings_button_caption">Settings</string>
|
||||
</resources>
|
||||
|
|
|
@ -143,6 +143,7 @@
|
|||
<item name="ic_action_home2">@drawable/ic_action_home2_light</item>
|
||||
<item name="ic_action_marker2">@drawable/ic_action_marker2_light</item>
|
||||
<item name="search_background">@color/search_background_dark</item>
|
||||
<item name="ic_action_settings">@drawable/ic_action_settings_light</item>
|
||||
<item name="android:actionModeCloseDrawable">@drawable/action_mode_back</item>
|
||||
<item name="actionModeCloseDrawable">@drawable/action_mode_back</item>
|
||||
<item name="android:actionModeStyle">@style/WhiteActionMode</item>
|
||||
|
@ -177,7 +178,8 @@
|
|||
<item name="ic_action_info2">@drawable/ic_action_info2_dark</item>
|
||||
<item name="ic_action_home2">@drawable/ic_action_home2_dark</item>
|
||||
<item name="ic_action_marker2">@drawable/ic_action_marker2_dark</item>
|
||||
<item name="search_background">@color/color_white</item>
|
||||
<item name="search_background">@color/color_white</item>
|
||||
<item name="ic_action_settings">@drawable/ic_action_settings_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="OsmandLightDarkActionBarTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
|
|
117
OsmAnd/src/net/osmand/plus/activities/PluginActivity.java
Normal file
117
OsmAnd/src/net/osmand/plus/activities/PluginActivity.java
Normal file
|
@ -0,0 +1,117 @@
|
|||
package net.osmand.plus.activities;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandPlugin;
|
||||
import net.osmand.plus.R;
|
||||
|
||||
/**
|
||||
* Created by Alexey Pelykh on 02.02.2015.
|
||||
*/
|
||||
public class PluginActivity extends OsmandActionBarActivity {
|
||||
private static final String TAG = "PluginActivity";
|
||||
public static final String EXTRA_PLUGIN_ID = "plugin_id";
|
||||
|
||||
private OsmandPlugin plugin;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
Intent intent = getIntent();
|
||||
if (intent == null || !intent.hasExtra(EXTRA_PLUGIN_ID)) {
|
||||
Log.e(TAG, "Required extra '" + EXTRA_PLUGIN_ID + "' is missing");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
String pluginId = intent.getStringExtra(EXTRA_PLUGIN_ID);
|
||||
if (pluginId == null) {
|
||||
Log.e(TAG, "Extra '" + EXTRA_PLUGIN_ID + "' is null");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
for (OsmandPlugin plugin : OsmandPlugin.getAvailablePlugins()) {
|
||||
if (!plugin.getId().equals(pluginId))
|
||||
continue;
|
||||
|
||||
this.plugin = plugin;
|
||||
break;
|
||||
}
|
||||
if (plugin == null) {
|
||||
Log.e(TAG, "Plugin '" + EXTRA_PLUGIN_ID + "' not found");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
boolean isEnabled = OsmandPlugin.getEnabledPlugins().contains(plugin);
|
||||
|
||||
setContentView(R.layout.plugin);
|
||||
getSupportActionBar().setTitle(plugin.getName());
|
||||
|
||||
TextView descriptionView = (TextView)findViewById(R.id.plugin_description);
|
||||
descriptionView.setText(plugin.getDescription());
|
||||
|
||||
final Class<? extends Activity> settingsActivity = plugin.getSettingsActivity();
|
||||
final Button settingsButton = (Button)findViewById(R.id.plugin_settings);
|
||||
if (settingsActivity == null) {
|
||||
settingsButton.setVisibility(View.GONE);
|
||||
} else {
|
||||
settingsButton.setEnabled(isEnabled);
|
||||
settingsButton.setVisibility(View.VISIBLE);
|
||||
settingsButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
startActivity(new Intent(PluginActivity.this, settingsActivity));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
CompoundButton enableDisableButton = (CompoundButton)findViewById(
|
||||
R.id.plugin_enable_disable);
|
||||
enableDisableButton.setChecked(isEnabled);
|
||||
enableDisableButton.setOnCheckedChangeListener(
|
||||
new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
boolean isEnabled = OsmandPlugin.getEnabledPlugins().contains(plugin);
|
||||
if (isEnabled == isChecked) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean ok = OsmandPlugin.enablePlugin((OsmandApplication)getApplication(), plugin,
|
||||
isChecked);
|
||||
settingsButton.setEnabled(isChecked && ok);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
CompoundButton enableDisableButton = (CompoundButton)findViewById(
|
||||
R.id.plugin_enable_disable);
|
||||
boolean isEnabled = OsmandPlugin.getEnabledPlugins().contains(plugin);
|
||||
enableDisableButton.setChecked(isEnabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int itemId = item.getItemId();
|
||||
switch (itemId) {
|
||||
case android.R.id.home:
|
||||
finish();
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -44,13 +44,9 @@ public class PluginsActivity extends OsmandListActivity {
|
|||
return;
|
||||
}
|
||||
|
||||
//TODO: open details
|
||||
togglePluginEnabled(plugin);
|
||||
}
|
||||
|
||||
private void togglePluginEnabled(OsmandPlugin plugin) {
|
||||
boolean isEnabled = OsmandPlugin.getEnabledPlugins().contains(plugin);
|
||||
enableDisablePlugin(plugin, !isEnabled);
|
||||
Intent intent = new Intent(this, PluginActivity.class);
|
||||
intent.putExtra(PluginActivity.EXTRA_PLUGIN_ID, plugin.getId());
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
private void enableDisablePlugin(OsmandPlugin plugin, boolean enable) {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
package net.osmand.plus.dashboard;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.osmand.plus.OsmandPlugin;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.PluginActivity;
|
||||
import net.osmand.plus.development.OsmandDevelopmentPlugin;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
|
@ -24,87 +23,126 @@ import android.widget.TextView;
|
|||
* Created by Denis on 21.11.2014.
|
||||
*/
|
||||
public class DashPluginsFragment extends DashBaseFragment {
|
||||
private final CompoundButton.OnCheckedChangeListener enableDisableListener =
|
||||
new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
OsmandPlugin plugin = (OsmandPlugin)buttonView.getTag();
|
||||
boolean isEnabled = OsmandPlugin.getEnabledPlugins().contains(plugin);
|
||||
|
||||
public static final String TAG = "DASH_PLUGINS_FRAGMENT";
|
||||
private ArrayList<OsmandPlugin> showedPlugins;
|
||||
private ArrayList<CompoundButton> checks;
|
||||
if (isEnabled == isChecked) {
|
||||
return;
|
||||
}
|
||||
|
||||
OsmandPlugin.enablePlugin(getMyApplication(), plugin, isChecked);
|
||||
}
|
||||
};
|
||||
|
||||
private final View.OnClickListener pluginSettingsListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
OsmandPlugin plugin = (OsmandPlugin)view.getTag();
|
||||
|
||||
Class<? extends Activity> settingsActivity = plugin.getSettingsActivity();
|
||||
startActivity(new Intent(getActivity(), settingsActivity));
|
||||
}
|
||||
};
|
||||
|
||||
private final View.OnClickListener pluginDetailsListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
OsmandPlugin plugin = (OsmandPlugin)view.getTag();
|
||||
|
||||
Intent intent = new Intent(getActivity(), PluginActivity.class);
|
||||
intent.putExtra(PluginActivity.EXTRA_PLUGIN_ID, plugin.getId());
|
||||
startActivity(intent);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
View view = getActivity().getLayoutInflater().inflate(R.layout.dash_plugins_fragment,
|
||||
container, false);
|
||||
view.findViewById(R.id.show_all).setOnClickListener(new View.OnClickListener() {
|
||||
View contentView = inflater.inflate(R.layout.dash_plugins_fragment, container, false);
|
||||
contentView.findViewById(R.id.show_all).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
startActivityForResult(new Intent(getActivity(),
|
||||
getMyApplication().getAppCustomization().getPluginsActivity()), 1);
|
||||
startActivity(new Intent(getActivity(),
|
||||
getMyApplication().getAppCustomization().getPluginsActivity()));
|
||||
}
|
||||
});
|
||||
LinearLayout layout = (LinearLayout) view.findViewById(R.id.plugins);
|
||||
addPlugins(inflater, layout);
|
||||
return view;
|
||||
|
||||
LinearLayout pluginsContainer = (LinearLayout) contentView.findViewById(R.id.plugins);
|
||||
List<OsmandPlugin> enabledPlugins = OsmandPlugin.getEnabledPlugins();
|
||||
for(OsmandPlugin plugin : enabledPlugins) {
|
||||
if (plugin instanceof OsmandDevelopmentPlugin) {
|
||||
continue;
|
||||
}
|
||||
|
||||
inflatePluginView(inflater, pluginsContainer, plugin);
|
||||
}
|
||||
for(OsmandPlugin plugin : OsmandPlugin.getAvailablePlugins()) {
|
||||
if (pluginsContainer.getChildCount() > 2) {
|
||||
break;
|
||||
}
|
||||
if (plugin instanceof OsmandDevelopmentPlugin) {
|
||||
continue;
|
||||
}
|
||||
if (enabledPlugins.contains(plugin)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
inflatePluginView(inflater, pluginsContainer, plugin);
|
||||
}
|
||||
|
||||
return contentView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
for (int i = 0; i < checks.size(); i++) {
|
||||
final CompoundButton ch = checks.get(i);
|
||||
final OsmandPlugin o = showedPlugins.get(i);
|
||||
ch.setOnCheckedChangeListener(null);
|
||||
ch.setChecked(OsmandPlugin.getEnabledPlugins().contains(o));
|
||||
ch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
|
||||
OsmandPlugin.enablePlugin(getMyApplication(), o, b);
|
||||
}
|
||||
});
|
||||
|
||||
View contentView = getView();
|
||||
if (contentView == null) {
|
||||
return;
|
||||
}
|
||||
LinearLayout pluginsContainer = (LinearLayout) contentView.findViewById(R.id.plugins);
|
||||
|
||||
List<OsmandPlugin> enabledPlugins = OsmandPlugin.getEnabledPlugins();
|
||||
for (int pluginIndex = 0; pluginIndex < pluginsContainer.getChildCount(); pluginIndex++) {
|
||||
View pluginView = pluginsContainer.getChildAt(pluginIndex);
|
||||
OsmandPlugin plugin = (OsmandPlugin)pluginView.getTag();
|
||||
boolean isEnabled = enabledPlugins.contains(plugin);
|
||||
|
||||
CompoundButton enableDisableButton = (CompoundButton) pluginView.findViewById(
|
||||
R.id.check_item);
|
||||
enableDisableButton.setChecked(isEnabled);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void addPlugins(LayoutInflater inflater, View parent) {
|
||||
LinearLayout layout = (LinearLayout) parent;
|
||||
private void inflatePluginView(LayoutInflater inflater, ViewGroup container,
|
||||
OsmandPlugin plugin) {
|
||||
boolean isEnabled = OsmandPlugin.getEnabledPlugins().contains(plugin);
|
||||
boolean hasSettings = (plugin.getSettingsActivity() != null);
|
||||
|
||||
List<OsmandPlugin> availablePlugins = OsmandPlugin.getAvailablePlugins();
|
||||
List<OsmandPlugin> enabledPlugins = OsmandPlugin.getEnabledPlugins();
|
||||
List<OsmandPlugin> toShow = new ArrayList<OsmandPlugin>();
|
||||
showedPlugins = new ArrayList<OsmandPlugin>();
|
||||
checks = new ArrayList<CompoundButton>();
|
||||
for(OsmandPlugin o : availablePlugins) {
|
||||
if(!(o instanceof OsmandDevelopmentPlugin)) {
|
||||
if(enabledPlugins.contains(o)) {
|
||||
showedPlugins.add(o);
|
||||
} else{
|
||||
toShow.add(o);
|
||||
}
|
||||
}
|
||||
View view = inflater.inflate(R.layout.dash_plugin_item, container, false);
|
||||
view.setTag(plugin);
|
||||
if (isEnabled && hasSettings) {
|
||||
view.setOnClickListener(pluginSettingsListener);
|
||||
} else {
|
||||
view.setOnClickListener(pluginDetailsListener);
|
||||
}
|
||||
Collections.shuffle(toShow, new Random(System.currentTimeMillis()));
|
||||
while (!toShow.isEmpty()) {
|
||||
showedPlugins.add(toShow.remove(0));
|
||||
if (showedPlugins.size() > 2) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < showedPlugins.size(); i++) {
|
||||
final OsmandPlugin plugin = showedPlugins.get(i);
|
||||
View view = inflater.inflate(R.layout.dash_plugin_item, layout, false);
|
||||
|
||||
((TextView) view.findViewById(R.id.plugin_name)).setText(plugin.getName());
|
||||
((ImageView) view.findViewById(R.id.plugin_logo)).setImageResource(
|
||||
plugin.getLogoResourceId());
|
||||
TextView nameView = (TextView)view.findViewById(R.id.plugin_name);
|
||||
nameView.setText(plugin.getName());
|
||||
|
||||
CompoundButton check = (CompoundButton) view.findViewById(R.id.check_item);
|
||||
checks.add(check);
|
||||
check.setChecked(enabledPlugins.contains(plugin));
|
||||
// int height = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 50, getResources()
|
||||
// .getDisplayMetrics());
|
||||
// LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, height);
|
||||
// view.setLayoutParams(lp);
|
||||
layout.addView(view);
|
||||
}
|
||||
ImageView logoView = (ImageView)view.findViewById(R.id.plugin_logo);
|
||||
logoView.setImageResource(plugin.getLogoResourceId());
|
||||
|
||||
CompoundButton enableDisableButton = (CompoundButton)view.findViewById(R.id.check_item);
|
||||
enableDisableButton.setTag(plugin);
|
||||
enableDisableButton.setChecked(isEnabled);
|
||||
enableDisableButton.setOnCheckedChangeListener(enableDisableListener);
|
||||
|
||||
container.addView(view);
|
||||
}
|
||||
}
|
||||
|
|
10
plugins/.gitignore
vendored
Normal file
10
plugins/.gitignore
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Android Studio
|
||||
*/.idea
|
||||
*/*.iml
|
||||
|
||||
# Gradle
|
||||
*/.gradle
|
||||
*/local.properties
|
||||
|
||||
# Output files
|
||||
*/build
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="EclipseModuleManager" forced_jdk="true">
|
||||
<conelement value="com.android.ide.eclipse.adt.DEPENDENCIES" />
|
||||
<src_description expected_position="1">
|
||||
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
|
||||
<src_folder value="file://$MODULE_DIR$/gen" expected_position="1" />
|
||||
<src_folder value="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK" expected_position="2" />
|
||||
<src_folder value="com.android.ide.eclipse.adt.LIBRARIES" expected_position="3" />
|
||||
</src_description>
|
||||
</component>
|
||||
<component name="FacetManager">
|
||||
<facet type="android" name="Android">
|
||||
<configuration />
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="false">
|
||||
<output url="file://$MODULE_DIR$/bin/classes" />
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android 4.1.2 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
|
67
plugins/OsmAnd-AddressPlugin/build.gradle
Normal file
67
plugins/OsmAnd-AddressPlugin/build.gradle
Normal file
|
@ -0,0 +1,67 @@
|
|||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 21
|
||||
buildToolsVersion "21.1.2"
|
||||
|
||||
signingConfigs {
|
||||
development {
|
||||
storeFile file("../../../keystores/debug.keystore")
|
||||
storePassword "android"
|
||||
keyAlias "androiddebugkey"
|
||||
keyPassword "android"
|
||||
}
|
||||
|
||||
publishing {
|
||||
storeFile file("../../osmand_key")
|
||||
storePassword System.getenv("OSMAND_APK_PASSWORD")
|
||||
keyAlias "androiddebugkey"
|
||||
keyPassword System.getenv("OSMAND_APK_PASSWORD")
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 9
|
||||
targetSdkVersion 21
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile "AndroidManifest.xml"
|
||||
jni.srcDirs = []
|
||||
jniLibs.srcDirs = []
|
||||
aidl.srcDirs = ["src"]
|
||||
java.srcDirs = ["src"]
|
||||
resources.srcDirs = ["src"]
|
||||
renderscript.srcDirs = ["src"]
|
||||
res.srcDirs = ["res"]
|
||||
assets.srcDirs = ["assets"]
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
signingConfig signingConfigs.development
|
||||
}
|
||||
release {
|
||||
signingConfig signingConfigs.publishing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
ivy {
|
||||
name = "OsmAndBinariesIvy"
|
||||
url = "http://builder.osmand.net"
|
||||
layout "pattern", {
|
||||
artifact "ivy/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
}
|
67
plugins/Osmand-ParkingPlugin/build.gradle
Normal file
67
plugins/Osmand-ParkingPlugin/build.gradle
Normal file
|
@ -0,0 +1,67 @@
|
|||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 21
|
||||
buildToolsVersion "21.1.2"
|
||||
|
||||
signingConfigs {
|
||||
development {
|
||||
storeFile file("../../../keystores/debug.keystore")
|
||||
storePassword "android"
|
||||
keyAlias "androiddebugkey"
|
||||
keyPassword "android"
|
||||
}
|
||||
|
||||
publishing {
|
||||
storeFile file("../../osmand_key")
|
||||
storePassword System.getenv("OSMAND_APK_PASSWORD")
|
||||
keyAlias "androiddebugkey"
|
||||
keyPassword System.getenv("OSMAND_APK_PASSWORD")
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 9
|
||||
targetSdkVersion 21
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile "AndroidManifest.xml"
|
||||
jni.srcDirs = []
|
||||
jniLibs.srcDirs = []
|
||||
aidl.srcDirs = ["src"]
|
||||
java.srcDirs = ["src"]
|
||||
resources.srcDirs = ["src"]
|
||||
renderscript.srcDirs = ["src"]
|
||||
res.srcDirs = ["res"]
|
||||
assets.srcDirs = ["assets"]
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
signingConfig signingConfigs.development
|
||||
}
|
||||
release {
|
||||
signingConfig signingConfigs.publishing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
ivy {
|
||||
name = "OsmAndBinariesIvy"
|
||||
url = "http://builder.osmand.net"
|
||||
layout "pattern", {
|
||||
artifact "ivy/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="EclipseModuleManager" forced_jdk="true">
|
||||
<conelement value="com.android.ide.eclipse.adt.DEPENDENCIES" />
|
||||
<src_description expected_position="1">
|
||||
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
|
||||
<src_folder value="file://$MODULE_DIR$/gen" expected_position="1" />
|
||||
<src_folder value="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK" expected_position="2" />
|
||||
<src_folder value="com.android.ide.eclipse.adt.LIBRARIES" expected_position="3" />
|
||||
</src_description>
|
||||
</component>
|
||||
<component name="FacetManager">
|
||||
<facet type="android" name="Android">
|
||||
<configuration />
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="false">
|
||||
<output url="file://$MODULE_DIR$/bin/classes" />
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android 4.1.2 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
|
67
plugins/Osmand-SRTMPlugin/build.gradle
Normal file
67
plugins/Osmand-SRTMPlugin/build.gradle
Normal file
|
@ -0,0 +1,67 @@
|
|||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 21
|
||||
buildToolsVersion "21.1.2"
|
||||
|
||||
signingConfigs {
|
||||
development {
|
||||
storeFile file("../../../keystores/debug.keystore")
|
||||
storePassword "android"
|
||||
keyAlias "androiddebugkey"
|
||||
keyPassword "android"
|
||||
}
|
||||
|
||||
publishing {
|
||||
storeFile file("../../osmand_key")
|
||||
storePassword System.getenv("OSMAND_APK_PASSWORD")
|
||||
keyAlias "androiddebugkey"
|
||||
keyPassword System.getenv("OSMAND_APK_PASSWORD")
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 9
|
||||
targetSdkVersion 21
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile "AndroidManifest.xml"
|
||||
jni.srcDirs = []
|
||||
jniLibs.srcDirs = []
|
||||
aidl.srcDirs = ["src"]
|
||||
java.srcDirs = ["src"]
|
||||
resources.srcDirs = ["src"]
|
||||
renderscript.srcDirs = ["src"]
|
||||
res.srcDirs = ["res"]
|
||||
assets.srcDirs = ["assets"]
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
signingConfig signingConfigs.development
|
||||
}
|
||||
release {
|
||||
signingConfig signingConfigs.publishing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
ivy {
|
||||
name = "OsmAndBinariesIvy"
|
||||
url = "http://builder.osmand.net"
|
||||
layout "pattern", {
|
||||
artifact "ivy/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
}
|
67
plugins/Osmand-Sherpafy/build.gradle
Normal file
67
plugins/Osmand-Sherpafy/build.gradle
Normal file
|
@ -0,0 +1,67 @@
|
|||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 21
|
||||
buildToolsVersion "21.1.2"
|
||||
|
||||
signingConfigs {
|
||||
development {
|
||||
storeFile file("../../../keystores/debug.keystore")
|
||||
storePassword "android"
|
||||
keyAlias "androiddebugkey"
|
||||
keyPassword "android"
|
||||
}
|
||||
|
||||
publishing {
|
||||
storeFile file("../../osmand_key")
|
||||
storePassword System.getenv("OSMAND_APK_PASSWORD")
|
||||
keyAlias "androiddebugkey"
|
||||
keyPassword System.getenv("OSMAND_APK_PASSWORD")
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 9
|
||||
targetSdkVersion 21
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile "AndroidManifest.xml"
|
||||
jni.srcDirs = []
|
||||
jniLibs.srcDirs = []
|
||||
aidl.srcDirs = ["src"]
|
||||
java.srcDirs = ["src"]
|
||||
resources.srcDirs = ["src"]
|
||||
renderscript.srcDirs = ["src"]
|
||||
res.srcDirs = ["res"]
|
||||
assets.srcDirs = ["assets"]
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
signingConfig signingConfigs.development
|
||||
}
|
||||
release {
|
||||
signingConfig signingConfigs.publishing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
ivy {
|
||||
name = "OsmAndBinariesIvy"
|
||||
url = "http://builder.osmand.net"
|
||||
layout "pattern", {
|
||||
artifact "ivy/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
}
|
|
@ -1,2 +1,6 @@
|
|||
include ':OsmAnd-java'
|
||||
include ':OsmAnd'
|
||||
include ':plugins:OsmAnd-AddressPlugin'
|
||||
include ':plugins:Osmand-ParkingPlugin'
|
||||
include ':plugins:Osmand-Sherpafy'
|
||||
include ':plugins:Osmand-SRTMPlugin'
|
||||
|
|
Loading…
Reference in a new issue