mirror of
https://github.com/nerzhul/ownCloud-SMS-App.git
synced 2025-06-08 00:16:09 +00:00
Add a basic listview as a PoC to choose accounts (this doesn't use accounts atm)
This commit is contained in:
parent
88a45634a2
commit
d39e314707
@ -106,6 +106,10 @@
|
|||||||
android:name=".activities.LoginActivity"
|
android:name=".activities.LoginActivity"
|
||||||
android:label="@string/title_activity_login" >
|
android:label="@string/title_activity_login" >
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".activities.RestoreSMSAccountListActivity"
|
||||||
|
android:label="@string/title_activity_select_account" >
|
||||||
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.GeneralSettingsActivity"
|
android:name=".activities.GeneralSettingsActivity"
|
||||||
android:label="@string/title_activity_general_settings" >
|
android:label="@string/title_activity_general_settings" >
|
||||||
@ -119,10 +123,10 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<!--<activity
|
||||||
android:name=".MainActivity2"
|
android:name=".MainActivity2"
|
||||||
android:label="@string/title_activity_main_activity2" >
|
android:label="@string/title_activity_main_activity2" >
|
||||||
</activity>
|
</activity>-->
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@ -102,6 +102,29 @@
|
|||||||
android:background="@drawable/standard_button"
|
android:background="@drawable/standard_button"
|
||||||
style="@style/StandardButton"
|
style="@style/StandardButton"
|
||||||
android:text="@string/ma_button_sync_accounts_now" />
|
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
|
<ImageView
|
||||||
android:id="@+id/imageView1"
|
android:id="@+id/imageView1"
|
||||||
@ -109,7 +132,7 @@
|
|||||||
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_restore_choose_account"
|
||||||
android:layout_marginTop="33dp"
|
android:layout_marginTop="33dp"
|
||||||
android:src="@drawable/next_arrow" />
|
android:src="@drawable/next_arrow" />
|
||||||
|
|
||||||
|
39
res/layout/restore_activity_accountlist.xml
Normal file
39
res/layout/restore_activity_accountlist.xml
Normal 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>
|
@ -138,6 +138,11 @@
|
|||||||
Contributors and issue\'s reporters</string>
|
Contributors and issue\'s reporters</string>
|
||||||
<string name="ma_title_sync_all">Synchronize all messages</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_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 -->
|
<!-- Notifications -->
|
||||||
<string name="sync_title">Sync process</string>
|
<string name="sync_title">Sync process</string>
|
||||||
|
@ -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) {
|
public void openGooglePlayStore(final View view) {
|
||||||
Intent intent;
|
Intent intent;
|
||||||
try {
|
try {
|
||||||
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user