mirror of
				https://github.com/nerzhul/ownCloud-SMS-App.git
				synced 2025-10-30 18:07:51 +00:00 
			
		
		
		
	Remote account interface improvements
This commit is contained in:
		
							parent
							
								
									b3f43ce1f5
								
							
						
					
					
						commit
						3895b8cf0b
					
				| @ -66,7 +66,6 @@ public class ContactListActivity extends Activity implements ASyncContactLoad { | |||||||
| 		final ProgressBar contactProgressBar = (ProgressBar) findViewById(R.id.contactlist_pgbar); | 		final ProgressBar contactProgressBar = (ProgressBar) findViewById(R.id.contactlist_pgbar); | ||||||
| 		final TextView contactPhoneList = (TextView) findViewById(R.id.contact_phonelist); | 		final TextView contactPhoneList = (TextView) findViewById(R.id.contact_phonelist); | ||||||
| 
 | 
 | ||||||
| 		sp.setVisibility(View.INVISIBLE); |  | ||||||
| 		contactInfos.setVisibility(View.INVISIBLE); | 		contactInfos.setVisibility(View.INVISIBLE); | ||||||
| 
 | 
 | ||||||
| 		sp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | 		sp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | ||||||
| @ -139,22 +138,21 @@ public class ContactListActivity extends Activity implements ASyncContactLoad { | |||||||
| 			if (element.name.equals(accountName)) { | 			if (element.name.equals(accountName)) { | ||||||
| 				// Load "contacts" | 				// Load "contacts" | ||||||
| 				contactProgressBar.setVisibility(View.VISIBLE); | 				contactProgressBar.setVisibility(View.VISIBLE); | ||||||
| 				sp.setVisibility(View.INVISIBLE); | 				new ContactLoadTask(element, getBaseContext(), adapter, objects, _layout, contactProgressBar, contactInfos).execute(); | ||||||
| 				new ContactLoadTask(element, getBaseContext(), adapter, objects, _layout, contactProgressBar, sp).execute(); |  | ||||||
| 
 | 
 | ||||||
| 				// Add refresh handler | 				// Add refresh handler | ||||||
| 				_layout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { | 				_layout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { | ||||||
| 					@Override | 					@Override | ||||||
| 					public void onRefresh() { | 					public void onRefresh() { | ||||||
| 						_layout.setRefreshing(true); | 						_layout.setRefreshing(true); | ||||||
| 						sp.setVisibility(View.INVISIBLE); | 						contactInfos.setVisibility(View.INVISIBLE); | ||||||
| 						contactProgressBar.setVisibility(View.VISIBLE); | 						contactProgressBar.setVisibility(View.VISIBLE); | ||||||
| 						(new Handler()).post(new Runnable() { | 						(new Handler()).post(new Runnable() { | ||||||
| 							@Override | 							@Override | ||||||
| 							public void run() { | 							public void run() { | ||||||
| 								objects.clear(); | 								objects.clear(); | ||||||
| 								adapter.notifyDataSetChanged(); | 								adapter.notifyDataSetChanged(); | ||||||
| 								new ContactLoadTask(element, getBaseContext(), adapter, objects, _layout, contactProgressBar, sp).execute(); | 								new ContactLoadTask(element, getBaseContext(), adapter, objects, _layout, contactProgressBar, contactInfos).execute(); | ||||||
| 							} | 							} | ||||||
| 						}); | 						}); | ||||||
| 					} | 					} | ||||||
|  | |||||||
| @ -10,8 +10,8 @@ import android.os.AsyncTask; | |||||||
| import android.provider.ContactsContract; | import android.provider.ContactsContract; | ||||||
| import android.support.v4.widget.SwipeRefreshLayout; | import android.support.v4.widget.SwipeRefreshLayout; | ||||||
| import android.view.View; | import android.view.View; | ||||||
|  | import android.widget.LinearLayout; | ||||||
| import android.widget.ProgressBar; | import android.widget.ProgressBar; | ||||||
| import android.widget.Spinner; |  | ||||||
| 
 | 
 | ||||||
| import org.json.JSONArray; | import org.json.JSONArray; | ||||||
| import org.json.JSONException; | import org.json.JSONException; | ||||||
| @ -32,11 +32,11 @@ public interface ASyncContactLoad { | |||||||
| 		private final ArrayList<String> _objects; | 		private final ArrayList<String> _objects; | ||||||
| 		private final SwipeRefreshLayout _layout; | 		private final SwipeRefreshLayout _layout; | ||||||
| 		private final ProgressBar _pg; | 		private final ProgressBar _pg; | ||||||
| 		private final Spinner _contactSpinner; | 		private final LinearLayout _contactLayout; | ||||||
| 
 | 
 | ||||||
| 		public ContactLoadTask(Account account, Context context, | 		public ContactLoadTask(Account account, Context context, | ||||||
| 				ContactListAdapter adapter, ArrayList<String> objects, SwipeRefreshLayout layout, | 				ContactListAdapter adapter, ArrayList<String> objects, SwipeRefreshLayout layout, | ||||||
| 				ProgressBar pg, Spinner sp) { | 				ProgressBar pg, LinearLayout sp) { | ||||||
| 			if (ContactLoadTask._accountMgr == null) { | 			if (ContactLoadTask._accountMgr == null) { | ||||||
|                 ContactLoadTask._accountMgr = AccountManager.get(context); |                 ContactLoadTask._accountMgr = AccountManager.get(context); | ||||||
| 			} | 			} | ||||||
| @ -47,7 +47,7 @@ public interface ASyncContactLoad { | |||||||
| 			_objects = objects; | 			_objects = objects; | ||||||
| 			_layout = layout; | 			_layout = layout; | ||||||
| 			_pg = pg; | 			_pg = pg; | ||||||
| 			_contactSpinner = sp; |             _contactLayout = sp; | ||||||
| 		} | 		} | ||||||
| 		@Override | 		@Override | ||||||
| 		protected Boolean doInBackground(Void... params) { | 		protected Boolean doInBackground(Void... params) { | ||||||
| @ -141,8 +141,8 @@ public interface ASyncContactLoad { | |||||||
| 				_pg.setVisibility(View.INVISIBLE); | 				_pg.setVisibility(View.INVISIBLE); | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			if (_contactSpinner != null) { | 			if (_contactLayout != null) { | ||||||
| 				_contactSpinner.setVisibility(View.VISIBLE); |                 _contactLayout.setVisibility(View.VISIBLE); | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | |||||||
| @ -103,7 +103,7 @@ | |||||||
|         style="@style/StandardButton" |         style="@style/StandardButton" | ||||||
|         android:text="@string/ma_button_sync_accounts_now" /> |         android:text="@string/ma_button_sync_accounts_now" /> | ||||||
|      |      | ||||||
|    <!--<TextView |    <TextView | ||||||
|         android:id="@+id/tv_remoteaccount" |         android:id="@+id/tv_remoteaccount" | ||||||
|         android:layout_width="wrap_content" |         android:layout_width="wrap_content" | ||||||
|         android:layout_height="wrap_content" |         android:layout_height="wrap_content" | ||||||
| @ -124,7 +124,7 @@ | |||||||
|         android:onClick="selectRemoteAccount" |         android:onClick="selectRemoteAccount" | ||||||
|         android:background="@drawable/standard_button" |         android:background="@drawable/standard_button" | ||||||
|         style="@style/StandardButton" |         style="@style/StandardButton" | ||||||
|         android:text="@string/choose_account" />--> |         android:text="@string/choose_account" /> | ||||||
| 
 | 
 | ||||||
|     <ImageView |     <ImageView | ||||||
|         android:id="@+id/imageView1" |         android:id="@+id/imageView1" | ||||||
| @ -132,9 +132,9 @@ | |||||||
|         android:layout_height="wrap_content" |         android:layout_height="wrap_content" | ||||||
|         android:layout_alignLeft="@+id/textView1" |         android:layout_alignLeft="@+id/textView1" | ||||||
|         android:layout_alignStart="@+id/textView1" |         android:layout_alignStart="@+id/textView1" | ||||||
|         android:layout_below="@+id/main_button_sync" |         android:layout_below="@+id/main_button_choose_account" | ||||||
|         android:layout_marginTop="33dp" |         android:layout_marginTop="33dp" | ||||||
|         android:src="@drawable/next_arrow" /> |         android:src="@drawable/next_arrow" /> | ||||||
|     <!--  android:layout_below="@+id/main_button_choose_account" --> |     <!--  android:layout_below="@+id/main_button_sync" --> | ||||||
| 
 | 
 | ||||||
| </RelativeLayout> | </RelativeLayout> | ||||||
| @ -35,6 +35,20 @@ | |||||||
| 		android:orientation="vertical" | 		android:orientation="vertical" | ||||||
| 		android:layout_width="match_parent" | 		android:layout_width="match_parent" | ||||||
| 		android:layout_height="match_parent" > | 		android:layout_height="match_parent" > | ||||||
|  | 		<LinearLayout | ||||||
|  | 			android:orientation="vertical" | ||||||
|  | 			android:layout_width="match_parent" | ||||||
|  | 			android:layout_height="wrap_content" | ||||||
|  | 			android:id="@+id/contactinfos_layout"> | ||||||
|  | 
 | ||||||
|  |             <TextView | ||||||
|  |                 android:layout_width="wrap_content" | ||||||
|  |                 android:layout_height="wrap_content" | ||||||
|  |                 android:textAppearance="?android:attr/textAppearanceLarge" | ||||||
|  |                 android:text="@string/contactinfos_list" | ||||||
|  |                 android:id="@+id/contactinfos_list" | ||||||
|  |                 android:paddingLeft="10dp" | ||||||
|  |                 android:textColor="@android:color/holo_blue_dark"/> | ||||||
| 
 | 
 | ||||||
|             <Spinner |             <Spinner | ||||||
|                 android:layout_width="match_parent" |                 android:layout_width="match_parent" | ||||||
| @ -42,21 +56,6 @@ | |||||||
|                 android:id="@+id/contact_spinner" |                 android:id="@+id/contact_spinner" | ||||||
|                 /> |                 /> | ||||||
| 
 | 
 | ||||||
| 		<ProgressBar |  | ||||||
| 			style="?android:attr/progressBarStyleLarge" |  | ||||||
| 			android:layout_width="match_parent" |  | ||||||
| 			android:id="@+id/contactlist_pgbar" |  | ||||||
| 			android:layout_gravity="center_horizontal" |  | ||||||
| 			android:indeterminateOnly="true" |  | ||||||
| 			android:indeterminate="true" |  | ||||||
| 			android:layout_height="wrap_content"/> |  | ||||||
| 
 |  | ||||||
| 		<LinearLayout |  | ||||||
| 			android:orientation="vertical" |  | ||||||
| 			android:layout_width="match_parent" |  | ||||||
| 			android:layout_height="wrap_content" |  | ||||||
| 			android:id="@+id/contactinfos_layout"> |  | ||||||
| 
 |  | ||||||
| 			<TextView | 			<TextView | ||||||
|                 android:layout_width="wrap_content" |                 android:layout_width="wrap_content" | ||||||
|                 android:layout_height="wrap_content" |                 android:layout_height="wrap_content" | ||||||
| @ -83,7 +82,13 @@ | |||||||
| 				android:autoText="false" | 				android:autoText="false" | ||||||
| 				android:paddingLeft="40dp"/> | 				android:paddingLeft="40dp"/> | ||||||
| 		</LinearLayout> | 		</LinearLayout> | ||||||
| 
 |         <ProgressBar | ||||||
| 
 |             style="?android:attr/progressBarStyleLarge" | ||||||
|  |             android:layout_width="match_parent" | ||||||
|  |             android:id="@+id/contactlist_pgbar" | ||||||
|  |             android:layout_gravity="center_horizontal" | ||||||
|  |             android:indeterminateOnly="true" | ||||||
|  |             android:indeterminate="true" | ||||||
|  |             android:layout_height="wrap_content"/> | ||||||
| 	</LinearLayout> | 	</LinearLayout> | ||||||
| </android.support.v4.widget.SwipeRefreshLayout> | </android.support.v4.widget.SwipeRefreshLayout> | ||||||
| @ -164,5 +164,6 @@ Contributors and issue\'s reporters</string> | |||||||
|     <string name="choose_account">Choose account</string> |     <string name="choose_account">Choose account</string> | ||||||
|     <string name="subtitle_contact_phones">> Contact phones</string> |     <string name="subtitle_contact_phones">> Contact phones</string> | ||||||
|     <string name="pref_title_bulk_messages">Max messages to send per sync</string> |     <string name="pref_title_bulk_messages">Max messages to send per sync</string> | ||||||
|  |     <string name="contactinfos_list">Contact list</string> | ||||||
| 
 | 
 | ||||||
| </resources> | </resources> | ||||||
|  | |||||||
| @ -149,4 +149,5 @@ Les contributeurs et rapporteurs de bugs</string> | |||||||
|     <string name="err_sync_create_json_request_encoding">Erreur #7: Encodage inconnu à la conversion</string> |     <string name="err_sync_create_json_request_encoding">Erreur #7: Encodage inconnu à la conversion</string> | ||||||
|     <string name="err_sync_craft_http_request">Erreur #2: Echec de la création de la requête</string> |     <string name="err_sync_craft_http_request">Erreur #2: Echec de la création de la requête</string> | ||||||
|     <string name="pref_title_bulk_messages">Nombre maximum de messages à envoyer par synchronisation</string> |     <string name="pref_title_bulk_messages">Nombre maximum de messages à envoyer par synchronisation</string> | ||||||
|  |     <string name="contactinfos_list">Liste des contacts</string> | ||||||
| </resources> | </resources> | ||||||
|  | |||||||
| @ -193,4 +193,5 @@ Contributors and issue\'s reporters</string> | |||||||
|     <string name="contactinfos_title">Contact informations</string> |     <string name="contactinfos_title">Contact informations</string> | ||||||
|     <string name="subtitle_contact_phones">> Contact phones</string> |     <string name="subtitle_contact_phones">> Contact phones</string> | ||||||
|     <string name="pref_title_bulk_messages">Max messages to send per sync</string> |     <string name="pref_title_bulk_messages">Max messages to send per sync</string> | ||||||
|  |     <string name="contactinfos_list">Contact list</string> | ||||||
| </resources> | </resources> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user