1
0
mirror of https://github.com/nerzhul/ownCloud-SMS-App.git synced 2025-06-07 16:06:18 +00:00

Add a basic listview as a PoC to choose accounts (this doesn't use accounts atm)

This commit is contained in:
Loic Blot 2015-05-03 16:31:28 +02:00
parent 88a45634a2
commit d39e314707
6 changed files with 108 additions and 3 deletions

View File

@ -106,6 +106,10 @@
android:name=".activities.LoginActivity"
android:label="@string/title_activity_login" >
</activity>
<activity
android:name=".activities.RestoreSMSAccountListActivity"
android:label="@string/title_activity_select_account" >
</activity>
<activity
android:name=".activities.GeneralSettingsActivity"
android:label="@string/title_activity_general_settings" >
@ -119,10 +123,10 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
<!--<activity
android:name=".MainActivity2"
android:label="@string/title_activity_main_activity2" >
</activity>
</activity>-->
</application>
</manifest>

View File

@ -102,6 +102,29 @@
android:background="@drawable/standard_button"
style="@style/StandardButton"
android:text="@string/ma_button_sync_accounts_now" />
<TextView
android:id="@+id/tv_restoremsgs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/main_tv_accounts"
android:layout_alignStart="@+id/main_tv_accounts"
android:layout_below="@+id/main_button_sync"
android:layout_marginTop="18dp"
android:text="@string/ma_title_restore_messages"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="@+id/main_button_restore_choose_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_restoremsgs"
android:layout_centerHorizontal="true"
android:layout_marginTop="19dp"
android:onClick="selectAccountForRestauration"
android:background="@drawable/standard_button"
style="@style/StandardButton"
android:text="@string/ma_button_restore_messages" />
<ImageView
android:id="@+id/imageView1"
@ -109,7 +132,7 @@
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_alignStart="@+id/textView1"
android:layout_below="@+id/main_button_sync"
android:layout_below="@+id/main_button_restore_choose_account"
android:layout_marginTop="33dp"
android:src="@drawable/next_arrow" />

View File

@ -0,0 +1,39 @@
<!--
/*
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:drawSelectorOnTop="false" />
</LinearLayout>

View File

@ -138,6 +138,11 @@
Contributors and issue\'s reporters</string>
<string name="ma_title_sync_all">Synchronize all messages</string>
<string name="ma_button_sync_accounts_now">Launch synchronization now</string>
<string name="ma_title_restore_messages">Restore messages</string>
<string name="ma_button_restore_messages">Choose account</string>
<!-- Restauration -->
<string name="title_activity_select_account">Select account</string>
<!-- Notifications -->
<string name="sync_title">Sync process</string>

View File

@ -181,6 +181,10 @@ public class MainActivity extends Activity {
}
}
public void selectAccountForRestauration(final View view) {
startActivity(new Intent(this, RestoreSMSAccountListActivity.class));
}
public void openGooglePlayStore(final View view) {
Intent intent;
try {

View File

@ -0,0 +1,30 @@
package fr.unix_experience.owncloud_sms.activities;
import java.util.ArrayList;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import fr.unix_experience.owncloud_sms.R;
public class RestoreSMSAccountListActivity extends ListActivity {
ArrayList<String> listItems = new ArrayList<String>();
ArrayAdapter<String> adapter;
@Override
public void onCreate(final Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.restore_activity_accountlist);
adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1,
listItems);
setListAdapter(adapter);
listItems.add("test");
listItems.add("test2");
listItems.add("test3");
listItems.add("test4s");
adapter.notifyDataSetChanged();
}
}