hides incomplete features
This commit is contained in:
parent
a8f8ece438
commit
5bf81e64bc
|
@ -573,7 +573,8 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
|
|||
@IntDef(value = {
|
||||
FilterFlags.QUOTE_NOT_AVAILABLE,
|
||||
FilterFlags.BLOCKING_USER,
|
||||
FilterFlags.BLOCKED_BY_USER
|
||||
FilterFlags.BLOCKED_BY_USER,
|
||||
FilterFlags.POSSIBILITY_SENSITIVE
|
||||
}, flag = true)
|
||||
public @interface FilterFlags {
|
||||
/**
|
||||
|
@ -583,6 +584,8 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
|
|||
* <li/>You were blocked by this user
|
||||
* <li/>You blocked/muted this user
|
||||
* <li/>Original tweet was marked sensitive and your account settings blocked them
|
||||
* <li/>Original tweet was deleted
|
||||
* <li/>Original tweet author blocked or blocked by quoted tweet author
|
||||
*/
|
||||
long QUOTE_NOT_AVAILABLE = 0x1;
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.mariotaku.twidere.util.sync.dropbox;
|
|||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.util.Xml
|
||||
import com.dropbox.core.DbxDownloader
|
||||
import com.dropbox.core.DbxException
|
||||
import com.dropbox.core.DbxRequestConfig
|
||||
|
@ -13,13 +12,15 @@ import nl.komponents.kovenant.ui.failUi
|
|||
import nl.komponents.kovenant.ui.successUi
|
||||
import org.mariotaku.twidere.BuildConfig
|
||||
import org.mariotaku.twidere.extension.model.*
|
||||
import org.mariotaku.twidere.extension.newPullParser
|
||||
import org.mariotaku.twidere.extension.newSerializer
|
||||
import org.mariotaku.twidere.model.Draft
|
||||
import org.mariotaku.twidere.model.FiltersData
|
||||
import org.mariotaku.twidere.util.TaskServiceRunner
|
||||
import org.mariotaku.twidere.util.sync.*
|
||||
import org.xmlpull.v1.XmlPullParser
|
||||
import org.xmlpull.v1.XmlSerializer
|
||||
import java.io.*
|
||||
import java.io.Closeable
|
||||
import java.io.FileNotFoundException
|
||||
import java.io.IOException
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
|
@ -140,7 +141,7 @@ class DropboxSyncTaskRunner(context: Context, val authToken: String) : SyncTaskR
|
|||
|
||||
override fun DbxDownloader<FileMetadata>.loadFromRemote(): FiltersData {
|
||||
val data = FiltersData()
|
||||
data.parse(inputStream.newPullParser())
|
||||
data.parse(inputStream.newPullParser(charset = Charsets.UTF_8))
|
||||
data.initFields()
|
||||
return data
|
||||
}
|
||||
|
@ -156,7 +157,7 @@ class DropboxSyncTaskRunner(context: Context, val authToken: String) : SyncTaskR
|
|||
override fun newSaveToRemoteSession(): DropboxUploadSession<FiltersData> {
|
||||
return object : DropboxUploadSession<FiltersData>(filePath, client) {
|
||||
override fun performUpload(uploader: UploadUploader, data: FiltersData) {
|
||||
data.serialize(uploader.outputStream.newSerializer(true))
|
||||
data.serialize(uploader.outputStream.newSerializer(charset = Charsets.UTF_8, indent = true))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -189,7 +190,8 @@ class DropboxSyncTaskRunner(context: Context, val authToken: String) : SyncTaskR
|
|||
override fun newSaveToRemoteSession(): DropboxUploadSession<Map<String, String>> {
|
||||
return object : DropboxUploadSession<Map<String, String>>(filePath, client) {
|
||||
override fun performUpload(uploader: UploadUploader, data: Map<String, String>) {
|
||||
data.serialize(uploader.outputStream.newSerializer(true))
|
||||
data.serialize(uploader.outputStream.newSerializer(charset = Charsets.UTF_8,
|
||||
indent = true))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -227,20 +229,6 @@ class DropboxSyncTaskRunner(context: Context, val authToken: String) : SyncTaskR
|
|||
|
||||
companion object {
|
||||
|
||||
@Throws(IOException::class)
|
||||
private fun InputStream.newPullParser(): XmlPullParser {
|
||||
val parser = Xml.newPullParser()
|
||||
parser.setInput(this, "UTF-8")
|
||||
return parser
|
||||
}
|
||||
|
||||
@Throws(IOException::class)
|
||||
private fun OutputStream.newSerializer(indent: Boolean = true): XmlSerializer {
|
||||
val serializer = Xml.newSerializer()
|
||||
serializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", indent)
|
||||
serializer.setOutput(this, "UTF-8")
|
||||
return serializer
|
||||
}
|
||||
|
||||
@Throws(IOException::class)
|
||||
private fun DbxClientV2.newUploader(path: String, clientModified: Long): UploadUploader {
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
package org.mariotaku.twidere.util.sync.google
|
||||
|
||||
import android.content.Context
|
||||
|
||||
/**
|
||||
* Created by mariotaku on 2017/1/6.
|
||||
*/
|
||||
|
||||
class GoogleDriveSyncTaskRunner(context: Context) {
|
||||
|
||||
}
|
|
@ -484,12 +484,12 @@
|
|||
<service
|
||||
android:name=".service.LegacyTaskService"
|
||||
android:enabled="@bool/use_legacy_refresh_service"
|
||||
android:label="@string/label_refresh_service"/>
|
||||
android:label="@string/label_refresh_and_sync_service"/>
|
||||
<service
|
||||
android:name=".service.JobTaskService"
|
||||
android:enabled="@bool/use_job_refresh_service"
|
||||
android:exported="true"
|
||||
android:label="@string/label_refresh_service"
|
||||
android:label="@string/label_refresh_and_sync_service"
|
||||
android:permission="android.permission.BIND_JOB_SERVICE"/>
|
||||
<service
|
||||
android:name=".service.StreamingService"
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
package org.mariotaku.twidere.extension
|
||||
|
||||
import android.util.Xml
|
||||
import org.xmlpull.v1.XmlPullParser
|
||||
import org.xmlpull.v1.XmlSerializer
|
||||
import java.io.*
|
||||
import java.nio.charset.Charset
|
||||
|
||||
/**
|
||||
* Created by mariotaku on 2017/1/6.
|
||||
*/
|
||||
|
||||
@Throws(IOException::class)
|
||||
fun InputStream.newPullParser(charset: Charset = Charset.defaultCharset()): XmlPullParser {
|
||||
val parser = Xml.newPullParser()
|
||||
parser.setInput(InputStreamReader(this, charset))
|
||||
return parser
|
||||
}
|
||||
|
||||
@Throws(IOException::class)
|
||||
fun OutputStream.newSerializer(charset: Charset = Charset.defaultCharset(),
|
||||
indent: Boolean = true): XmlSerializer {
|
||||
val serializer = Xml.newSerializer()
|
||||
serializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", indent)
|
||||
serializer.setOutput(OutputStreamWriter(this, charset))
|
||||
return serializer
|
||||
}
|
|
@ -42,6 +42,7 @@
|
|||
<string name="password">Password</string>
|
||||
<string name="label_data_provider">Twidere database provider</string>
|
||||
<string name="label_refresh_service">Refresh service</string>
|
||||
<string name="label_refresh_and_sync_service">Refresh & Sync service</string>
|
||||
<string name="label_streaming_service">Streaming service</string>
|
||||
<string name="label_background_operation_service">Background operation service</string>
|
||||
<string name="action_open_in_browser">Open in browser</string>
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
android:defaultValue="false"
|
||||
android:key="filter_possibility_sensitive_statuses"
|
||||
android:title="@string/preference_filter_possibility_sensitive_statuses"/>
|
||||
<PreferenceCategory android:title="@string/preference_title_filter_subscriptions">
|
||||
<Preference android:title="@string/preference_title_filter_manage_subscriptions">
|
||||
<intent
|
||||
android:data="twidere://filters/subscriptions"
|
||||
android:targetClass="org.mariotaku.twidere.activity.LinkHandlerActivity"
|
||||
android:targetPackage="org.mariotaku.twidere"/>
|
||||
</Preference>
|
||||
</PreferenceCategory>
|
||||
<!--<PreferenceCategory android:title="@string/preference_title_filter_subscriptions">-->
|
||||
<!--<Preference android:title="@string/preference_title_filter_manage_subscriptions">-->
|
||||
<!--<intent-->
|
||||
<!--android:data="twidere://filters/subscriptions"-->
|
||||
<!--android:targetClass="org.mariotaku.twidere.activity.LinkHandlerActivity"-->
|
||||
<!--android:targetPackage="org.mariotaku.twidere"/>-->
|
||||
<!--</Preference>-->
|
||||
<!--</PreferenceCategory>-->
|
||||
</PreferenceScreen>
|
Loading…
Reference in New Issue