Some sync adapter code and bugfixes around it - not yet functional
This commit is contained in:
@ -1,83 +1,81 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp">
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/address"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="BM-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
android:id="@+id/address"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="BM-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/label_wrapper"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/address">
|
||||
android:id="@+id/label_wrapper"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/address">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/label"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPersonName"
|
||||
android:hint="@string/label"/>
|
||||
android:id="@+id/label"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/label"
|
||||
android:inputType="textPersonName" />
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<Switch
|
||||
android:id="@+id/import_contact"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/import_contact"
|
||||
android:layout_below="@+id/label_wrapper"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="8dp"/>
|
||||
android:id="@+id/import_contact"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/label_wrapper"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/import_contact" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/subscribe"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/subscribe"
|
||||
android:layout_below="@+id/import_contact"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
android:id="@+id/subscribe"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/import_contact"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/subscribe" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/compose_message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Message"
|
||||
style="?android:attr/borderlessButtonStyle"
|
||||
android:layout_below="@+id/subscribe"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="12dp"/>
|
||||
android:id="@+id/do_import"
|
||||
style="?android:attr/borderlessButtonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@+id/subscribe"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/do_import" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/do_import"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/do_import"
|
||||
style="?android:attr/borderlessButtonStyle"
|
||||
android:layout_below="@+id/subscribe"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="12dp"/>
|
||||
android:id="@+id/compose_message"
|
||||
style="?android:attr/borderlessButtonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/do_import"
|
||||
android:layout_below="@+id/subscribe"
|
||||
android:layout_toLeftOf="@+id/do_import"
|
||||
android:layout_toStartOf="@+id/do_import"
|
||||
android:text="@string/write_message" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/cancel"
|
||||
style="?android:attr/borderlessButtonStyle"
|
||||
android:layout_alignTop="@+id/do_import"
|
||||
android:layout_toLeftOf="@+id/do_import"
|
||||
android:layout_toStartOf="@+id/do_import"/>
|
||||
android:id="@+id/cancel"
|
||||
style="?android:attr/borderlessButtonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/compose_message"
|
||||
android:layout_toLeftOf="@+id/compose_message"
|
||||
android:layout_toStartOf="@+id/compose_message"
|
||||
android:text="@string/cancel" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -33,4 +33,8 @@
|
||||
<string name="stream_number">Stream #%d</string>
|
||||
<string name="enabled">Aktiv</string>
|
||||
<string name="title_subscription_detail">Abonnement</string>
|
||||
<string name="sync_timeout">Zeitbeschränkung der Synchronisierung</string>
|
||||
<string name="sync_timeout_summary">Timeout in Sekunden</string>
|
||||
<string name="trusted_node">Vertrauenswürdiger Knoten</string>
|
||||
<string name="trusted_node_summary">Diese Adresse wird für die Synchronisation verwendet</string>
|
||||
</resources>
|
@ -33,4 +33,9 @@
|
||||
<string name="empty_trash">Empty Trash</string>
|
||||
<string name="stream_number">Stream #%d</string>
|
||||
<string name="enabled">Enabled</string>
|
||||
<string name="trusted_node">Trusted node</string>
|
||||
<string name="trusted_node_summary">Use this node for synchronization</string>
|
||||
<string name="sync_timeout">Synchronization Timeout</string>
|
||||
<string name="sync_timeout_summary">Timeout in seconds</string>
|
||||
<string name="write_message">Write message</string>
|
||||
</resources>
|
||||
|
6
app/src/main/res/xml/authenticator.xml
Normal file
6
app/src/main/res/xml/authenticator.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:accountType="bitmessage.dissem.ch"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:smallIcon="@mipmap/ic_launcher" />
|
@ -9,8 +9,19 @@
|
||||
android:entryValues="@array/connection_mode_values"/>
|
||||
-->
|
||||
<SwitchPreference
|
||||
android:key="wifi_only"
|
||||
android:title="@string/wifi_only"
|
||||
android:summary="@string/wifi_only_summary"
|
||||
android:defaultValue="true"/>
|
||||
android:defaultValue="true"
|
||||
android:key="wifi_only"
|
||||
android:summary="@string/wifi_only_summary"
|
||||
android:title="@string/wifi_only" />
|
||||
<EditTextPreference
|
||||
android:inputType="textUri"
|
||||
android:key="trusted_node"
|
||||
android:summary="@string/trusted_node_summary"
|
||||
android:title="@string/trusted_node" />
|
||||
<EditTextPreference
|
||||
android:defaultValue="120"
|
||||
android:inputType="number"
|
||||
android:key="sync_timeout"
|
||||
android:summary="@string/sync_timeout_summary"
|
||||
android:title="@string/sync_timeout" />
|
||||
</PreferenceScreen>
|
9
app/src/main/res/xml/syncadapter.xml
Normal file
9
app/src/main/res/xml/syncadapter.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<sync-adapter
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:contentAuthority="ch.dissem.bitmessage.provider"
|
||||
android:accountType="ch.dissem.bitmessage"
|
||||
android:userVisible="true"
|
||||
android:supportsUploading="true"
|
||||
android:allowParallelSyncs="false"
|
||||
android:isAlwaysSyncable="true"/>
|
Reference in New Issue
Block a user