Skip to content

Commit

Permalink
2.3.2
Browse files Browse the repository at this point in the history
minor fixes
  • Loading branch information
shineangelic committed Oct 29, 2019
1 parent bcbc311 commit 4b0c7e5
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 107 deletions.
4 changes: 1 addition & 3 deletions SoulissApp/SoulissApp.iml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res;file://$MODULE_DIR$/build/generated/res/resValues/debug" />
<option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="" />
<option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
Expand Down Expand Up @@ -89,8 +89,6 @@
</content>
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test:runner:1.2.0@aar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: androidx.test:monitor:1.2.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.collection:collection:1.1.0@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.arch.core:core-common:2.1.0@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.room:room-common:2.2.0@jar" level="project" />
Expand Down
2 changes: 1 addition & 1 deletion SoulissApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dependencies {
testImplementation 'junit:junit:4.12'
// Required for instrumented tests
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:runner:1.1.0'
// androidTestImplementation 'androidx.work:work-testing:2.2.0'

implementation project(':ecoGallery')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.interpolator.view.animation.LinearOutSlowInInterpolator;
Expand Down Expand Up @@ -135,14 +134,27 @@ void initDrawer(final @NonNull Activity parentActivity, int activeSection) {
) {
/** Called when a drawer has settled in a completely closed state. */
public void onDrawerClosed(View view) {
try {
FloatingActionButton fab = findViewById(R.id.fab);
fab.show();
} catch (Exception ue) {
//no problem
}
super.onDrawerClosed(view);
ActivityCompat.invalidateOptionsMenu(parentActivity);
parentActivity.invalidateOptionsMenu();
}

/** Called when a drawer has settled in a completely open state. */
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
ActivityCompat.invalidateOptionsMenu(parentActivity);
try {
FloatingActionButton fab = findViewById(R.id.fab);
fab.hide();
} catch (Exception ue) {
//no problem
}

parentActivity.invalidateOptionsMenu();
info2.setText(getString(R.string.souliss_app_name) + " " + (opzioni.isSoulissReachable() ? getString(R.string.Online) : getString(R.string.offline))
+ " - " + getString(R.string.active_config) + ": " + SoulissApp.getCurrentConfig());
info1.setText("Souliss is controlling " + opzioni
Expand Down Expand Up @@ -176,7 +188,7 @@ public void onClick(View v) {

mDrawerList = findViewById(R.id.left_drawer);
// Set the drawer toggle as the DrawerListener
mDrawerLayout.setDrawerListener(mDrawerToggle);
mDrawerLayout.addDrawerListener(mDrawerToggle);

mDrawermAdapter = new NavDrawerAdapter(parentActivity, R.layout.drawer_list_item, dmh.getStuff(), activeSection);
mDrawerList.setAdapter(mDrawermAdapter);
Expand Down
33 changes: 17 additions & 16 deletions SoulissApp/src/main/java/it/angelic/soulissclient/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private void configureVoiceFab() {
//VOICE SEARCH
FloatingActionButton fab = findViewById(R.id.fab);
if (opzioni.isVoiceCommandEnabled() && opzioni.isDbConfigured()) {
fab.show();

fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand All @@ -157,9 +157,9 @@ public void onClick(View v) {
}
}
});
fab.show();
} else {
fab.hide();
fab.hide();
}
}

Expand Down Expand Up @@ -547,20 +547,7 @@ protected void onStart() {
//refresh geofences
AsyncTask.execute(new GeofenceRunnable(MainActivity.this));

locationCallback = new LocationCallback() {
@Override
public void onLocationResult(LocationResult locationResult) {
Log.w(Constants.TAG, "RECEIVE POS updates " + locationResult);
if (locationResult == null) {
return;
}
for (Location location : locationResult.getLocations()) {
if (launcherMainAdapter.getLocationLauncherElements() != null) {
onLocationChanged(location);
}
}
}
};

startLocationUpdates();
} else if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
== PackageManager.PERMISSION_DENIED) {
Expand All @@ -575,6 +562,20 @@ public void onLocationResult(LocationResult locationResult) {
private void startLocationUpdates() {
Log.w(Constants.TAG, "Requesting POS updates ");
LocationRequest locReq = createLocationRequest();
locationCallback = new LocationCallback() {
@Override
public void onLocationResult(LocationResult locationResult) {
Log.w(Constants.TAG, "RECEIVE POS updates " + locationResult);
if (locationResult == null) {
return;
}
for (Location location : locationResult.getLocations()) {
if (launcherMainAdapter.getLocationLauncherElements() != null) {
onLocationChanged(location);
}
}
}
};
locationCli.requestLocationUpdates(locReq,
locationCallback,
Looper.getMainLooper());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import it.angelic.soulissclient.preferences.BroadcastSettingsFragment;
import it.angelic.soulissclient.preferences.DbSettingsFragment;
import it.angelic.soulissclient.preferences.LauncherSettingsFragment;
import it.angelic.soulissclient.preferences.NetSettingsFragmentNuova;
import it.angelic.soulissclient.preferences.NetSettingsFragment;
import it.angelic.soulissclient.preferences.ServiceSettingsFragment;
import it.angelic.soulissclient.preferences.VisualSettingsFragment;

Expand Down Expand Up @@ -52,8 +52,8 @@ protected void onCreate(Bundle savedInstanceState) {
PreferenceFragmentCompat collected = null;
if (extras != null && extras.get(PreferenceActivity.EXTRA_SHOW_FRAGMENT) != null) {
String classNAme = (String) extras.get(PreferenceActivity.EXTRA_SHOW_FRAGMENT);
if (NetSettingsFragmentNuova.class.getName().equals(classNAme))
collected = new NetSettingsFragmentNuova();
if (NetSettingsFragment.class.getName().equals(classNAme))
collected = new NetSettingsFragment();
if (BroadcastSettingsFragment.class.getName().equals(classNAme))
collected = new BroadcastSettingsFragment();
if (ServiceSettingsFragment.class.getName().equals(classNAme))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ public void onClick(View view) {
SoulissApp.setCurrentConfig(newConfig);
if (!(previousConfig.equalsIgnoreCase(newConfig))) {
//SAVE PREVIOUS if old one is not "create new" or "import"
if (!previousConfig.equals("") && !(previousConfig.equals(getResources().getStringArray(R.array.configChooserArray)[1]))
&& !(previousConfig.equals(getResources().getStringArray(R.array.configChooserArray)[2]))) {
if (!previousConfig.equals("") && !(previousConfig.equals(getResources().getStringArray(R.array.configChooserArray)[0]))
&& !(previousConfig.equals(getResources().getStringArray(R.array.configChooserArray)[1]))) {
//save Old DB and config
File filePrefs = new File(importDir, previousConfig + "_SoulissApp.prefs");
Log.w(Constants.TAG, "Saving old Preferences to: " + filePrefs.getPath());
Expand Down Expand Up @@ -359,9 +359,9 @@ public void onClick(View view) {
Log.e(Constants.TAG, "SERIO DB DEMO non generabile:" + newConfig);
}
}
} else if (newConfig.equals(getResources().getStringArray(R.array.configChooserArray)[1])) {
} else if (newConfig.equals(getResources().getStringArray(R.array.configChooserArray)[0])) {
Log.i(Constants.TAG, "Nothing here");
} else if (newConfig.equals(getResources().getStringArray(R.array.configChooserArray)[2])) {
} else if (newConfig.equals(getResources().getStringArray(R.array.configChooserArray)[1])) {
Log.i(Constants.TAG, "Nothing here");
} else { //caso dinamico
File filePrefs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import it.angelic.soulissclient.model.db.SoulissDBHelper;
import it.angelic.soulissclient.preferences.DbSettingsFragment;
import it.angelic.soulissclient.preferences.LauncherSettingsFragment;
import it.angelic.soulissclient.preferences.NetSettingsFragmentNuova;
import it.angelic.soulissclient.preferences.NetSettingsFragment;
import it.angelic.soulissclient.preferences.ServiceSettingsFragment;
import it.angelic.soulissclient.preferences.VisualSettingsFragment;

Expand Down Expand Up @@ -115,7 +115,7 @@ private void selectItem(int position, int id) {
mDrawerLayout.closeDrawer(mDrawerLinear);
Intent myIntent4 = new Intent(mActivity, SettingsActivity.class);
myIntent4.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
myIntent4.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, NetSettingsFragmentNuova.class.getName());
myIntent4.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, NetSettingsFragment.class.getName());
myIntent4.setAction("network_setup");
mActivity.startActivity(myIntent4);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
import it.angelic.soulissclient.model.db.SoulissDBTagHelper;
import it.angelic.soulissclient.net.UDPHelper;
import it.angelic.soulissclient.preferences.DbSettingsFragment;
import it.angelic.soulissclient.preferences.NetSettingsFragmentNuova;
import it.angelic.soulissclient.preferences.NetSettingsFragment;
import it.angelic.soulissclient.preferences.ServiceSettingsFragment;
import it.angelic.soulissclient.util.FontAwesomeEnum;
import it.angelic.soulissclient.util.FontAwesomeUtil;
Expand Down Expand Up @@ -89,7 +89,7 @@ public void onClick(DialogInterface dialog, int whichButton) {
final Intent preferencesActivity = new Intent(source.getBaseContext(),
SettingsActivity.class);

preferencesActivity.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, NetSettingsFragmentNuova.class.getName());
preferencesActivity.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, NetSettingsFragment.class.getName());
// preferencesActivity.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT_ARGUMENTS,com);
preferencesActivity.setAction("network_setup");
preferencesActivity.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
Expand Down Expand Up @@ -415,16 +415,13 @@ public void onClick(DialogInterface dialog, int whichButton) {
}

public static AlertDialog.Builder deleteConfigDialog(final Context cont, final Spinner toUpdate) {
ContextThemeWrapper wrapper = new ContextThemeWrapper(cont, SoulissApp.getOpzioni().isLightThemeSelected() ? R.style.LightThemeSelector : R.style.DarkThemeSelector);

final AlertDialog.Builder alert = new AlertDialog.Builder(cont,SoulissApp.getOpzioni().isLightThemeSelected() ? R.style.MyAlertDialogThemeLight:R.style.MyAlertDialogTheme);
final AlertDialog.Builder alert = new AlertDialog.Builder(wrapper, SoulissApp.getOpzioni().isLightThemeSelected() ? R.style.MyAlertDialogThemeLight : R.style.MyAlertDialogTheme);
final String bckConfig = (String) toUpdate.getSelectedItem();
alert.setIcon(R.drawable.ic_cancel_24dp);
alert.setTitle(cont.getString(R.string.delete) + " " + bckConfig);
alert.setTitle(cont.getString(R.string.delete) + " " + bckConfig + "?");

// Set an EditText view to get user input
//final EditText input = new EditText(cont);
//alert.setView(input);
//input.setText(bckConfig);
alert.setPositiveButton(cont.getResources().getString(android.R.string.ok),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
Expand All @@ -451,17 +448,19 @@ public void onClick(DialogInterface dialog, int whichButton) {
}

public static AlertDialog.Builder renameConfigDialog(final Context cont, final Spinner toUpdate) {
final AlertDialog.Builder alert = new AlertDialog.Builder(cont,SoulissApp.getOpzioni().isLightThemeSelected() ? R.style.MyAlertDialogThemeLight:R.style.MyAlertDialogTheme);
final SoulissPreferenceHelper opzioni = new SoulissPreferenceHelper(cont);
ContextThemeWrapper wrapper = new ContextThemeWrapper(cont, SoulissApp.getOpzioni().isLightThemeSelected() ? R.style.LightThemeSelector : R.style.DarkThemeSelector);

final AlertDialog.Builder alert = new AlertDialog.Builder(wrapper, SoulissApp.getOpzioni().isLightThemeSelected() ? R.style.MyAlertDialogThemeLight : R.style.MyAlertDialogTheme);
//final SoulissPreferenceHelper opzioni = new SoulissPreferenceHelper(cont);
final String bckConfig = (String) toUpdate.getSelectedItem();
alert.setIcon(R.drawable.ic_mode_edit_24dp);
alert.setTitle(cont.getString(R.string.rename) + " " + bckConfig);

// Set an EditText view to get user input
final EditText input = new EditText(cont);
final EditText input = new EditText(wrapper);
alert.setView(input);
input.setText(bckConfig);
alert.setPositiveButton(cont.getResources().getString(android.R.string.ok),
alert.setPositiveButton(wrapper.getResources().getString(android.R.string.ok),
new DialogInterface.OnClickListener() {

public void onClick(DialogInterface dialog, int whichButton) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import it.angelic.soulissclient.helpers.SoulissPreferenceHelper;


public class NetSettingsFragmentNuova extends PreferenceFragmentCompat {
public class NetSettingsFragment extends PreferenceFragmentCompat {

private SoulissPreferenceHelper opzioni;
private Preference userIndex;
Expand Down Expand Up @@ -49,7 +49,7 @@ public void onCreate(Bundle savedInstanceState) {
publicIP.setOnPreferenceChangeListener(ipChanger);

//BROADCAST Settings
bCast.setOnPreferenceClickListener(new BroadcastSettingsPreferenceListener(getActivity()));
//bCast.setOnPreferenceClickListener(new BroadcastSettingsPreferenceListener(getActivity()));


/*
Expand Down
2 changes: 1 addition & 1 deletion SoulissApp/src/main/res/xml/root_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</PreferenceCategory>

<Preference
app:fragment="it.angelic.soulissclient.preferences.NetSettingsFragmentNuova"
app:fragment="it.angelic.soulissclient.preferences.NetSettingsFragment"
app:icon="@android:drawable/ic_menu_mylocation"
app:title="@string/opt_network"
app:summary="@string/opt_networkdesc" />
Expand Down
14 changes: 8 additions & 6 deletions SoulissApp/src/main/res/xml/settings_net.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:icon="@android:drawable/ic_menu_mylocation"
android:key="network_setup"
android:summary="@string/opt_networkdesc"
android:title="@string/opt_network" >
android:title="@string/opt_network">

<PreferenceCategory android:title="@string/opt_net_home" >
<EditTextPreference
Expand Down Expand Up @@ -33,12 +34,13 @@
android:key="checkboxBroadcast"
android:summary="@string/opt_summary_broadcast"
android:title="@string/opt_title_broadcast" />
<Preference
android:name="advbroadcast"
android:dialogTitle="@string/opt_userindex"
android:key="advbroadcastKey"

<Preference
app:fragment="it.angelic.soulissclient.preferences.BroadcastSettingsFragment"
app:icon="@android:drawable/ic_menu_share"
android:summary="@string/advbroadcast_summary"
android:title="Broadcast Setting" />
android:title="Broadcast Setting to nodes" />

<EditTextPreference
android:name="udpport"
android:dialogTitle="@string/opt_udpport"
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ allprojects {
}

project.ext {
VERSION_NAME = "2.3.1"
VERSION_CODE = 231
VERSION_NAME = "2.3.2"
VERSION_CODE = 232
compileSdkVersion = 29
targetSdkVersion = 29
}

0 comments on commit 4b0c7e5

Please sign in to comment.