mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-04-01 22:31:51 -04:00
Add option to lock orientation state
This new option will control if the screen orientation lock option is displayed or not. If set, the orientation lock is forced and the unlock option is hidden.
This commit is contained in:
@@ -200,6 +200,12 @@ public class LoyaltyCardViewActivity extends AppCompatActivity
|
||||
{
|
||||
getMenuInflater().inflate(R.menu.card_view_menu, menu);
|
||||
|
||||
if(settings.getLockBarcodeScreenOrientation())
|
||||
{
|
||||
MenuItem item = menu.findItem(R.id.action_lock_unlock);
|
||||
setOrientatonLock(item, true);
|
||||
item.setVisible(false);
|
||||
}
|
||||
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@@ -68,4 +68,9 @@ public class Settings
|
||||
{
|
||||
return getBoolean(R.string.settings_key_display_barcode_max_brightness, true);
|
||||
}
|
||||
|
||||
public boolean getLockBarcodeScreenOrientation()
|
||||
{
|
||||
return getBoolean(R.string.settings_key_lock_barcode_orientation, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user