fix UI
fix VoiceRouter tabulation
This commit is contained in:
parent
4e5b942096
commit
9807fe212d
15 changed files with 993 additions and 946 deletions
File diff suppressed because it is too large
Load diff
|
@ -57,6 +57,9 @@ public class MainActivity extends AppCompatActivity {
|
|||
private LinearLayout llPluginPreferencesLayout;
|
||||
private RadioGroupWrapper osmandVersionRadioGroup;
|
||||
private FrameLayout btnOpenOsmand;
|
||||
private ImageView ivTimeSetUpIcon;
|
||||
private ImageView ivSensorIcon;
|
||||
private View bottomSensorCardShadow;
|
||||
private View osmandVersionsPanel;
|
||||
|
||||
private Paint pGreyScale;
|
||||
|
@ -99,6 +102,8 @@ public class MainActivity extends AppCompatActivity {
|
|||
tvTime = findViewById(R.id.tvTime);
|
||||
flPanelSensor = findViewById(R.id.flPanelSensor);
|
||||
swSensorEnableSwitcher = findViewById(R.id.swSensorEnableSwitcher);
|
||||
ivTimeSetUpIcon = findViewById(R.id.ivTimeSetUpIcon);
|
||||
ivSensorIcon = findViewById(R.id.ivSensorIcon);
|
||||
|
||||
btnOpenOsmand.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -271,6 +276,8 @@ public class MainActivity extends AppCompatActivity {
|
|||
tvPluginStateDescription.setText(getString(R.string.enabled));
|
||||
tvPluginStateDescription.setTextColor(getResources().getColor(R.color.black));
|
||||
tbPluginToolbar.setBackgroundColor(getResources().getColor(R.color.orange));
|
||||
ivTimeSetUpIcon.setColorFilter(ContextCompat.getColor(this, R.color.blue),
|
||||
android.graphics.PorterDuff.Mode.MULTIPLY);
|
||||
|
||||
llPluginPreferencesLayout.setLayerType(LAYER_TYPE_HARDWARE, null);
|
||||
|
||||
|
@ -289,6 +296,8 @@ public class MainActivity extends AppCompatActivity {
|
|||
tvPluginStateDescription.setText(getString(R.string.disabled));
|
||||
tvPluginStateDescription.setTextColor(getResources().getColor(R.color.darkGrey));
|
||||
tbPluginToolbar.setBackgroundColor(getResources().getColor(R.color.darkGrey));
|
||||
ivTimeSetUpIcon.setColorFilter(ContextCompat.getColor(this, R.color.darkGrey),
|
||||
android.graphics.PorterDuff.Mode.MULTIPLY);
|
||||
|
||||
llPluginPreferencesLayout.setLayerType(LAYER_TYPE_HARDWARE, pGreyScale);
|
||||
|
||||
|
@ -302,8 +311,12 @@ public class MainActivity extends AppCompatActivity {
|
|||
|
||||
if (isSensorEnabled) {
|
||||
sensorHelper.switchOnSensor();
|
||||
ivSensorIcon.setColorFilter(ContextCompat.getColor(this, R.color.blue),
|
||||
android.graphics.PorterDuff.Mode.MULTIPLY);
|
||||
} else {
|
||||
sensorHelper.switchOffSensor();
|
||||
ivSensorIcon.setColorFilter(ContextCompat.getColor(this, R.color.darkGrey),
|
||||
android.graphics.PorterDuff.Mode.MULTIPLY);
|
||||
}
|
||||
|
||||
PluginSettings.UnlockTime currentTime = settings.getTime();
|
||||
|
@ -316,7 +329,14 @@ public class MainActivity extends AppCompatActivity {
|
|||
availableOsmandVersions = PluginSettings.OsmandVersion.getOnlyInstalledVersions();
|
||||
llElementsScreen.removeView(osmandVersionsPanel);
|
||||
|
||||
if (bottomSensorCardShadow==null) {
|
||||
bottomSensorCardShadow = getLayoutInflater().inflate(R.layout.card_top_divider, null, false);
|
||||
llElementsScreen.addView(bottomSensorCardShadow);
|
||||
}
|
||||
|
||||
if (availableOsmandVersions.size() > 1) {
|
||||
llElementsScreen.removeView(bottomSensorCardShadow);
|
||||
bottomSensorCardShadow = null;
|
||||
osmandVersionsPanel = createOsmandVersionsPanel();
|
||||
llElementsScreen.addView(osmandVersionsPanel);
|
||||
|
||||
|
@ -335,9 +355,9 @@ public class MainActivity extends AppCompatActivity {
|
|||
private View createOsmandVersionsPanel() {
|
||||
LayoutInflater inflater = getLayoutInflater();
|
||||
|
||||
LinearLayout llWraper = new LinearLayout(MainActivity.this);
|
||||
llWraper.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||
llWraper.setOrientation(LinearLayout.VERTICAL);
|
||||
LinearLayout llWrapper = new LinearLayout(MainActivity.this);
|
||||
llWrapper.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||
llWrapper.setOrientation(LinearLayout.VERTICAL);
|
||||
|
||||
View panelOsmandVersions = inflater.inflate(R.layout.main_el_osmand_versions, null, false);
|
||||
LinearLayout llOsmandVersions = panelOsmandVersions.findViewById(R.id.llOsmandVersions);
|
||||
|
@ -379,11 +399,11 @@ public class MainActivity extends AppCompatActivity {
|
|||
View cardDevider = inflater.inflate(R.layout.card_devider, null, false);
|
||||
View cardTop = inflater.inflate(R.layout.card_top_divider, null, false);
|
||||
|
||||
llWraper.addView(cardDevider);
|
||||
llWraper.addView(panelOsmandVersions);
|
||||
llWraper.addView(cardTop);
|
||||
llWrapper.addView(cardDevider);
|
||||
llWrapper.addView(panelOsmandVersions);
|
||||
llWrapper.addView(cardTop);
|
||||
|
||||
return llWraper;
|
||||
return llWrapper;
|
||||
}
|
||||
|
||||
private void setEnableForElements(boolean enable) {
|
||||
|
|
|
@ -7,6 +7,8 @@ import android.support.v4.content.ContextCompat;
|
|||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import net.osmand.turnScreenOn.app.TurnScreenApp;
|
||||
|
@ -28,6 +30,8 @@ public class PluginDescriptionActivity extends AppCompatActivity {
|
|||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_plugin_description);
|
||||
|
||||
setStatusBarColor(R.color.white);
|
||||
|
||||
currentMode = getIntent().getIntExtra(MODE_KEY, MODE_HELP);
|
||||
|
||||
app = (TurnScreenApp) getApplicationContext();
|
||||
|
@ -72,4 +76,10 @@ public class PluginDescriptionActivity extends AppCompatActivity {
|
|||
public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
|
||||
super.onSaveInstanceState(outState, outPersistentState);
|
||||
}
|
||||
|
||||
private void setStatusBarColor(int colorResId) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
getWindow().setStatusBarColor(ContextCompat.getColor(this, colorResId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="false">
|
||||
<shape>
|
||||
<solid
|
||||
android:color="@color/white" />
|
||||
</shape>
|
||||
</item> <!-- pressed -->
|
||||
<item android:state_pressed="true" >
|
||||
<shape>
|
||||
<solid
|
||||
android:color="@color/lightGrey" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
|
@ -23,7 +23,7 @@
|
|||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="64dp"
|
||||
android:paddingLeft="72dp"
|
||||
android:paddingRight="64dp"
|
||||
android:text="@string/permissionDescription"
|
||||
android:textColor="@color/black"
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".PluginDescriptionActivity">
|
||||
tools:context=".PluginDescriptionActivity"
|
||||
android:background="@color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
|
||||
<include layout="@layout/card_bottom_divider"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
<View android:layout_width="match_parent"
|
||||
android:layout_height="4dp"/>
|
||||
|
||||
<include layout="@layout/card_top_divider"/>
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/horizontal_padding"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
|
@ -19,6 +18,7 @@
|
|||
android:layout_height="@dimen/basic_element_height"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginLeft="@dimen/horizontal_padding"
|
||||
android:layout_marginRight="@dimen/horizontal_padding"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
@ -35,6 +35,7 @@
|
|||
android:layout_gravity="end|bottom"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/cancel"
|
||||
android:layout_marginLeft="@dimen/horizontal_padding"
|
||||
android:layout_marginRight="@dimen/horizontal_padding"
|
||||
android:textColor="@color/blue"
|
||||
android:textSize="16sp" />
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/basic_element_height"
|
||||
android:layout_marginRight="@dimen/horizontal_padding">
|
||||
android:background="@drawable/btn_preference"
|
||||
android:layout_height="@dimen/basic_element_height">
|
||||
<TextView
|
||||
android:id="@+id/tvTime"
|
||||
android:layout_width="0dp"
|
||||
|
@ -15,6 +15,7 @@
|
|||
android:textSize="16sp"
|
||||
android:textColor="@color/black"
|
||||
android:gravity="start"
|
||||
android:layout_marginLeft="@dimen/horizontal_padding"
|
||||
android:layout_gravity="center_vertical"/>
|
||||
|
||||
<RadioButton
|
||||
|
@ -22,6 +23,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="@dimen/horizontal_padding"
|
||||
style="@style/RadioButtonStyle"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
android:layout_height="@dimen/basic_element_height">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSensorIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivTimeSetUpIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
|
|
|
@ -15,4 +15,5 @@
|
|||
<color name="black">#000000</color>
|
||||
<color name="pluginDescHeader">#6617D3</color>
|
||||
<color name="pluginDescSubHeader">#A99CBA</color>
|
||||
<color name="lightGrey">#eeeeee</color>
|
||||
</resources>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<string name="OsmandVersion">OsmAnd Version</string>
|
||||
<string name="OsmandPlus">OsmAnd Plus</string>
|
||||
<string name="Osmand">OsmAnd</string>
|
||||
<string name="continueDesc">continue</string>
|
||||
<string name="continueDesc">Continue</string>
|
||||
<string name="sensorHeader">Использовать датчик приближения</string>
|
||||
<string name="help">Help</string>
|
||||
<string name="install_instruction">You need to install <b>OsmAnd</b> or <b>OsmAnd+</b>, to use this plugin.</string>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<style name="RadioButtonStyle" parent="Theme.AppCompat.Light">
|
||||
<!--<item name="colorControlNormal">@color/darkGrey</item>-->
|
||||
<item name="colorControlActivated">@color/blue</item>
|
||||
<item name="android:background">@color/white</item>
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<style name="turnScreenOnHeaderTextStyle">
|
||||
|
|
|
@ -4,4 +4,4 @@ include ':plugins:Osmand-Nautical'
|
|||
include ':plugins:OsmAnd-TurnScreenOn'
|
||||
include ':plugins:Osmand-ParkingPlugin'
|
||||
include ':plugins:Osmand-SRTMPlugin'
|
||||
include ':plugins:Osmand-Skimaps'
|
||||
include ':plugins:Osmand-Skimaps'
|
Loading…
Reference in a new issue