First attempt at implementing the compact layout
This commit is contained in:
		
							parent
							
								
									b2d6e79d30
								
							
						
					
					
						commit
						a17d09e0a2
					
				| @ -138,6 +138,8 @@ | ||||
| 	<string name="antinonfreedep">Dependencies</string> | ||||
| 	<string name="antinonfreedeplong">Show apps that depend on other non-free apps</string> | ||||
| 
 | ||||
| 	<string name="display">Display</string> | ||||
| 
 | ||||
| 	<string name="expert">Expert</string> | ||||
| 	<string name="expert_mode">Enable expert mode</string> | ||||
| 
 | ||||
| @ -174,5 +176,7 @@ | ||||
|     <string name="showPermissions">Show permissions</string> | ||||
|     <string name="showPermissions_long">Display a list of permissions an app needs</string> | ||||
|     <string name="no_handler_app">You don\'t have any app installed that can handle %s</string> | ||||
|     <string name="compactlayout">Compact Layout</string> | ||||
|     <string name="compactlayout_long">Hide app summaries when listing apps</string> | ||||
| 
 | ||||
| </resources> | ||||
|  | ||||
| @ -26,6 +26,14 @@ | ||||
| 			android:summary="@string/update_history_desc" | ||||
| 			android:title="@string/update_history" /> | ||||
| 	</PreferenceCategory> | ||||
| 	<PreferenceCategory android:title="@string/display"> | ||||
|         <CheckBoxPreference android:title="@string/showPermissions" | ||||
|             android:defaultValue="false" android:summary="@string/showPermissions_long" | ||||
|             android:key="showPermissions"/> | ||||
|         <CheckBoxPreference android:title="@string/compactlayout" | ||||
|             android:defaultValue="false" android:summary="@string/compactlayout_long" | ||||
|             android:key="compactlayout"/> | ||||
| 	</PreferenceCategory> | ||||
| 	<PreferenceCategory android:title="@string/antifeatures"> | ||||
| 		<CheckBoxPreference android:title="@string/antiads" | ||||
| 			android:defaultValue="false" android:summary="@string/antiadslong" | ||||
| @ -53,8 +61,7 @@ | ||||
| 		<CheckBoxPreference android:title="@string/ignoreTouch" | ||||
| 			android:defaultValue="false" android:summary="@string/ignoreTouch_long" | ||||
| 			android:key="ignoreTouchscreen" /> | ||||
| 		<CheckBoxPreference android:key="showPermissions" android:summary="@string/showPermissions_long" android:title="@string/showPermissions" android:defaultValue="false"/> | ||||
| 			</PreferenceCategory> | ||||
| 	</PreferenceCategory> | ||||
| 	<PreferenceCategory android:title="@string/maintenance"> | ||||
| 		<Preference android:title="@string/reset" android:summary="@string/clear_all_cached_data" | ||||
| 			android:key="reset" /> | ||||
|  | ||||
| @ -6,6 +6,8 @@ import java.util.List; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| import android.net.Uri; | ||||
| import android.preference.PreferenceManager; | ||||
| import android.content.SharedPreferences; | ||||
| import android.view.LayoutInflater; | ||||
| import android.view.View; | ||||
| import android.view.ViewGroup; | ||||
| @ -18,8 +20,13 @@ public class AppListAdapter extends BaseAdapter { | ||||
|     private List<DB.App> items = new ArrayList<DB.App>(); | ||||
|     private Context mContext; | ||||
| 
 | ||||
|     private boolean pref_compact; | ||||
| 
 | ||||
|     public AppListAdapter(Context context) { | ||||
|         mContext = context; | ||||
|         SharedPreferences prefs = PreferenceManager | ||||
|                 .getDefaultSharedPreferences(mContext); | ||||
|         pref_compact = prefs.getBoolean("compactlayout", false); | ||||
|     } | ||||
| 
 | ||||
|     public void addItem(DB.App app) { | ||||
| @ -79,7 +86,10 @@ public class AppListAdapter extends BaseAdapter { | ||||
|         license.setText(app.license); | ||||
| 
 | ||||
|         TextView summary = (TextView) v.findViewById(R.id.summary); | ||||
|         summary.setText(app.summary); | ||||
|         if (pref_compact) | ||||
|             summary.setVisibility(View.GONE); | ||||
|         else | ||||
|             summary.setText(app.summary); | ||||
| 
 | ||||
|         ImageView icon = (ImageView) v.findViewById(R.id.icon); | ||||
|         File icn = new File(DB.getIconsPath(), app.icon); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Daniel Martí
						Daniel Martí