Skip to content

Commit

Permalink
Merge pull request #1748 from DroidPlanner/release-3.2.1-beta8
Browse files Browse the repository at this point in the history
Release 3.2.1 beta 8
  • Loading branch information
m4gr3d committed May 13, 2016
2 parents bf96130 + 1d6c5c3 commit 46d07c7
Show file tree
Hide file tree
Showing 22 changed files with 269 additions and 107 deletions.
2 changes: 1 addition & 1 deletion Android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def versionPrefix = "Tower-v"
def versionMajor = 3
def versionMinor = 2
def versionPatch = 1
def versionBuild = 7 //bump for dogfood builds, public betas, etc.
def versionBuild = 8 //bump for dogfood builds, public betas, etc.

//Logging levels
def logLevelVerbose = 2;
Expand Down
6 changes: 3 additions & 3 deletions Android/res/layout/demo_changelog_fragment_dialogmaterial.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:paddingTop="8dp"
chg:rowHeaderLayoutId="@layout/changelogrowheader_material_layout"
chg:rowLayoutId="@layout/changelogrow_material_layout" />
android:paddingTop="4dp"
chg:rowHeaderLayoutId="@layout/layout_changelog_row_header"
chg:rowLayoutId="@layout/layout_changelog_row" />
42 changes: 42 additions & 0 deletions Android/res/layout/layout_changelog_row.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/chg_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="48dp"
android:orientation="horizontal">

<!-- ChangeLog Row [Bullet Point] You have to use the id="chg_textbullet" -->
<TextView
android:id="@+id/chg_textbullet"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:paddingLeft="12dp"
android:paddingStart="12dp"
android:text="@string/changelog_row_bulletpoint"
android:textAppearance="@android:style/TextAppearance.Large"
android:textColor="@color/chglib_material_color_text_1" />


<!-- ChangeLog Row [Text] You have to use the id="chg_text" -->
<TextView
android:id="@+id/chg_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="48dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingBottom="4dp"
android:paddingTop="4dp"
android:textColor="@color/chglib_material_color_text_1"
android:textSize="@dimen/chglib_material_list_fontsize"
tools:text="Use DashClock with Android 4.2's Daydream feature; great for use with desktop docks!" />
</LinearLayout>


45 changes: 45 additions & 0 deletions Android/res/layout/layout_changelog_row_header.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/chg_rowheader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="56dp"
android:orientation="horizontal"
android:paddingLeft="12dp"
android:paddingRight="12dp">


<!-- ChangeLog Header [Version] You have to use the id="chg_headerVersion" -->
<TextView
android:id="@+id/chg_headerVersion"
style="?android:attr/listSeparatorTextViewStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:textAllCaps="true"
android:textColor="@color/chglib_material_color_text_1"
android:textSize="@dimen/chglib_material_list_suheader_fontsize"
android:textStyle="bold"
tools:text="VERSION 1.5" />

<!-- ChangeLog Header [Date] You have to use the id="chg_headerDate" -->
<TextView
android:id="@+id/chg_headerDate"
style="?android:attr/listSeparatorTextViewStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingBottom="8dp"
android:paddingTop="8dp"
tools:text="JUNE 17,2013"
android:textAllCaps="true"
android:textColor="@color/chglib_material_color_text_1"
android:textSize="@dimen/chglib_material_list_suheader_fontsize"
android:textStyle="bold" />


</LinearLayout>
3 changes: 2 additions & 1 deletion Android/res/layout/popup_info_gps.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
style="@style/CardView.Light">

<LinearLayout
android:orientation="vertical"
Expand Down
3 changes: 2 additions & 1 deletion Android/res/layout/popup_info_power.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
style="@style/CardView.Light">

<LinearLayout
style="?android:attr/buttonBarStyle"
Expand Down
3 changes: 2 additions & 1 deletion Android/res/layout/popup_info_signal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
style="@style/CardView.Light">

<LinearLayout
android:orientation="vertical"
Expand Down
2 changes: 1 addition & 1 deletion Android/res/raw/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
in your View component in layout file -->


<changelogversion versionName="3.2.1" changeDate="May 11,2016">
<changelogversion versionName="3.2.1" changeDate="May 12,2016">
<changelogimprovement>[b]UVC[/b] devices support by [i]Guilherme Blanco[/i]</changelogimprovement>
<changelogimprovement>Google Cardboard [b]FPV[/b] support thanks to [b]DronePro[/b] by [i]Shawn Fraser[/i]</changelogimprovement>
<changelogimprovement>Add ability to set a custom video stream. Check the [i][b]Tower Wiki[/b][/i] for setup instructions</changelogimprovement>
Expand Down
2 changes: 1 addition & 1 deletion Android/res/xml/preferences_google_maps.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
android:title="@string/pref_title_enable_offline_map_layer"/>

<Preference
android:key="pref_mapbox_map_download"
android:key="pref_arcgis_map_download"
android:summary="@string/pref_summary_mapbox_map_download"
android:title="@string/pref_title_mapbox_map_download"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,9 @@
import android.support.v7.preference.DialogPreference;
import android.util.AttributeSet;

import org.droidplanner.android.utils.prefs.DroidPlannerPrefs;

public class ClearBTDialogPreference extends DialogPreference {

public interface OnResultListener {
void onResult(boolean result);
}

private DroidPlannerPrefs mAppPrefs;

private OnResultListener listener;

public ClearBTDialogPreference(Context context, AttributeSet attrs) {
super(context, attrs);
mAppPrefs = DroidPlannerPrefs.getInstance(context);
}

protected void onDialogClosed(boolean positiveResult) {
//TODO: figure out replacement
// super.onDialogClosed(positiveResult);
if (positiveResult) {
mAppPrefs.setBluetoothDeviceAddress("");
}

if(listener != null)
listener.onResult(positiveResult);
}

public void setOnResultListener(OnResultListener listener){
this.listener = listener;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package org.droidplanner.android.dialogs;

import android.os.Bundle;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceDialogFragmentCompat;

import org.droidplanner.android.utils.prefs.DroidPlannerPrefs;

/**
* Created by fhuya on 5/12/2016.
*/
public class ClearBTPreferenceFragmentCompat extends PreferenceDialogFragmentCompat {

public static ClearBTPreferenceFragmentCompat newInstance(Preference preference){
ClearBTPreferenceFragmentCompat fragment = new ClearBTPreferenceFragmentCompat();
Bundle bundle = new Bundle(1);
bundle.putString(ARG_KEY, preference.getKey());
fragment.setArguments(bundle);
return fragment;
}

@Override
public void onDialogClosed(boolean positiveResult) {
if(positiveResult) {
DroidPlannerPrefs.getInstance(getContext()).setBluetoothDeviceAddress("");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.droidplanner.android.dialogs;

import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
Expand All @@ -27,7 +26,6 @@

import org.droidplanner.android.R;

import it.gmariotti.changelibs.library.view.ChangeLogListView;
import it.gmariotti.changelibs.library.view.ChangeLogRecyclerView;


Expand All @@ -43,8 +41,7 @@ public DialogMaterialFragment() {

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
LayoutInflater layoutInflater = (LayoutInflater) getActivity().getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
LayoutInflater layoutInflater = getActivity().getLayoutInflater();
ChangeLogRecyclerView chgList = (ChangeLogRecyclerView) layoutInflater.inflate(R.layout.demo_changelog_fragment_dialogmaterial, null);

return new AlertDialog.Builder(getActivity(), R.style.AppCompatAlertDialogStyle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ import android.support.v4.app.DialogFragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ArrayAdapter
import android.widget.ListView
import android.widget.Toast
import org.droidplanner.android.R
import org.droidplanner.android.fragments.actionbar.SelectionListAdapter

/**
* Created by Fredia Huya-Kouadio on 9/25/15.
*/
public abstract class SelectionListDialog : DialogFragment(), SelectionListAdapter.SelectionListener {
abstract class SelectionListDialog : DialogFragment(), SelectionListAdapter.SelectionListener {

companion object {
@JvmStatic public fun newInstance(viewAdapter: SelectionListAdapter<*>?): SelectionListDialog {
Expand All @@ -29,7 +27,7 @@ public abstract class SelectionListDialog : DialogFragment(), SelectionListAdapt

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setStyle(DialogFragment.STYLE_NO_TITLE, 0)
setStyle(DialogFragment.STYLE_NO_TITLE, R.style.CustomDialogTheme)
isCancelable = true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void onSliderUnlocked() {
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setStyle(DialogFragment.STYLE_NO_FRAME, 0);
setStyle(DialogFragment.STYLE_NO_FRAME, R.style.CustomDialogTheme);
setCancelable(true);
}

Expand Down
23 changes: 6 additions & 17 deletions Android/src/org/droidplanner/android/dialogs/UVCDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.CheckedTextView;
import android.widget.Spinner;

Expand Down Expand Up @@ -67,7 +66,7 @@ public Dialog onCreateDialog(final Bundle savedInstanceState) {
builder.setTitle(R.string.uvc_device_select);
builder.setPositiveButton(android.R.string.ok, mOnDialogClickListener);
builder.setNegativeButton(android.R.string.cancel, mOnDialogClickListener);
builder.setNeutralButton(R.string.uvc_device_refresh, null);
builder.setNeutralButton(R.string.uvc_device_refresh, mOnDialogClickListener);
final Dialog dialog = builder.create();
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true);
Expand All @@ -84,22 +83,8 @@ private final View initView() {
final View empty = rootView.findViewById(android.R.id.empty);
mSpinner.setEmptyView(empty);
updateDevices();
final Button button = (Button)getDialog().findViewById(android.R.id.button3);
if (button != null) {
button.setOnClickListener(mOnClickListener);
}
return rootView;
}

private final View.OnClickListener mOnClickListener = new View.OnClickListener() {
@Override
public void onClick(final View v) {
switch (v.getId()) {
case android.R.id.button3:
updateDevices();
break;
}
}
return rootView;
};

private final DialogInterface.OnClickListener mOnDialogClickListener = new DialogInterface.OnClickListener() {
Expand All @@ -112,6 +97,10 @@ public void onClick(final DialogInterface dialog, final int which) {
if (mUSBMonitor != null) mUSBMonitor.requestPermission((UsbDevice)item);
}
break;

case DialogInterface.BUTTON_NEUTRAL:
updateDevices();
break;
}
}
};
Expand Down
Loading

0 comments on commit 46d07c7

Please sign in to comment.