Skip to content

Commit

Permalink
setting: upgrade bluetooth beta (#1388)
Browse files Browse the repository at this point in the history
  • Loading branch information
sriharivishnu authored Aug 20, 2020
1 parent 791f3ce commit ba9688a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import android.view.View
import android.widget.ImageView
import android.widget.Toast
import androidx.fragment.app.viewModels
import androidx.preference.PreferenceManager
import io.treehouses.remote.IntroActivity
import io.treehouses.remote.MainApplication
import io.treehouses.remote.R
Expand Down Expand Up @@ -200,7 +201,7 @@ open class BaseHomeFragment : BaseFragment() {
noInternetForBluetoothUpgrade()
}
//If there is no error, compare the server hashes to determine whether an upgrade is needed
else if (hashed.trim() != serverHash.trim()) {
else if (hashed.trim() != serverHash.trim() && PreferenceManager.getDefaultSharedPreferences(requireContext()).getBoolean("bluetooth_file_local_upgrade", false)) {
askForBluetoothUpgradeStable(localString)
}
}
Expand Down
15 changes: 11 additions & 4 deletions app/src/main/res/xml/app_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,17 @@

<PreferenceCategory android:title="Advanced" app:layout="@layout/custom_pref_category">
<Preference
android:layout="@layout/custom_pref_whole"
android:icon="@drawable/bluetooth"
android:key="bluetooth_file"
android:title="View Bluetooth Server File"/>
android:layout="@layout/custom_pref_top"
android:icon="@drawable/bluetooth"
android:key="bluetooth_file"
android:title="View Bluetooth Server File"/>

<SwitchPreference
android:layout="@layout/custom_pref_bottom"
android:defaultValue="false"
android:key="bluetooth_file_local_upgrade"
android:title="Sync Bluetooth File with Local File"
android:summary="Prompt for replacing the Bluetooth server on the Raspberry Pi with the one that is compatible with the one that is on the Remote."/>
</PreferenceCategory>

</PreferenceScreen>

0 comments on commit ba9688a

Please sign in to comment.