Beispiel #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    String locale = PreferenceConfiguration.readPreferences(this).language;
    if (!locale.equals(PreferenceConfiguration.DEFAULT_LANGUAGE)) {
      Configuration config = new Configuration(getResources().getConfiguration());
      config.locale = new Locale(locale);
      getResources().updateConfiguration(config, getResources().getDisplayMetrics());
    }

    // Bind to the computer manager service
    bindService(
        new Intent(PcView.this, ComputerManagerService.class),
        serviceConnection,
        Service.BIND_AUTO_CREATE);

    pcGridAdapter =
        new PcGridAdapter(
            this,
            PreferenceConfiguration.readPreferences(this).listMode,
            PreferenceConfiguration.readPreferences(this).smallIconMode);

    initializeViews();
  }
Beispiel #2
0
 @Override
 public int getAdapterFragmentLayoutId() {
   return PreferenceConfiguration.readPreferences(this).listMode
       ? R.layout.list_view
       : (PreferenceConfiguration.readPreferences(this).smallIconMode
           ? R.layout.pc_grid_view_small
           : R.layout.pc_grid_view);
 }