mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 04:04:18 +00:00 
			
		
		
		
	Can force to use mobile mode
This commit is contained in:
		@@ -11,12 +11,10 @@ import 'package:settings_ui/settings_ui.dart';
 | 
			
		||||
 | 
			
		||||
class ApplicationSettings extends StatefulWidget {
 | 
			
		||||
  @override
 | 
			
		||||
  _ApplicationSettingsState createState() =>
 | 
			
		||||
      _ApplicationSettingsState();
 | 
			
		||||
  _ApplicationSettingsState createState() => _ApplicationSettingsState();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class _ApplicationSettingsState
 | 
			
		||||
    extends State<ApplicationSettings> {
 | 
			
		||||
class _ApplicationSettingsState extends State<ApplicationSettings> {
 | 
			
		||||
  PreferencesHelper _preferencesHelper;
 | 
			
		||||
 | 
			
		||||
  Future<void> _refresh() async {
 | 
			
		||||
@@ -31,7 +29,11 @@ class _ApplicationSettingsState
 | 
			
		||||
 | 
			
		||||
  Widget _buildSections() {
 | 
			
		||||
    return SettingsList(
 | 
			
		||||
      sections: [_buildAppearanceSection(), _buildGeneralSection()],
 | 
			
		||||
      sections: [
 | 
			
		||||
        _buildAppearanceSection(),
 | 
			
		||||
        _buildGeneralSection(),
 | 
			
		||||
        _buildDebugSection()
 | 
			
		||||
      ],
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -61,6 +63,21 @@ class _ApplicationSettingsState
 | 
			
		||||
        ],
 | 
			
		||||
      );
 | 
			
		||||
 | 
			
		||||
  /// Debug section
 | 
			
		||||
  SettingsSection _buildDebugSection() => SettingsSection(
 | 
			
		||||
        title: tr("Debug features"),
 | 
			
		||||
        tiles: [
 | 
			
		||||
          _PreferencesSettingsTile(
 | 
			
		||||
            preferencesKey: PreferencesKeyList.FORCE_MOBILE_MODE,
 | 
			
		||||
            title: tr("Force mobile mode"),
 | 
			
		||||
            subtitle: tr(
 | 
			
		||||
                "Force the smartphone mode of the application to be used, even when tablet mode could be used."),
 | 
			
		||||
            onChange: _updatedSettings,
 | 
			
		||||
            helper: _preferencesHelper,
 | 
			
		||||
          ),
 | 
			
		||||
        ],
 | 
			
		||||
      );
 | 
			
		||||
 | 
			
		||||
  /// Apply new settings
 | 
			
		||||
  _updatedSettings() {
 | 
			
		||||
    setState(() {});
 | 
			
		||||
 
 | 
			
		||||
@@ -202,6 +202,7 @@ bool darkTheme() => preferences().getBool(PreferencesKeyList.ENABLE_DARK_THEME);
 | 
			
		||||
 | 
			
		||||
/// Check out whether we use tablet mode or not
 | 
			
		||||
bool isTablet(BuildContext context) =>
 | 
			
		||||
    !preferences().getBool(PreferencesKeyList.FORCE_MOBILE_MODE) &&
 | 
			
		||||
    MediaQuery.of(context).size.width >= 1024;
 | 
			
		||||
 | 
			
		||||
/// Show about Comunic dialog
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user