1
0
mirror of https://github.com/TwidereProject/Twidere-Android synced 2025-01-31 00:45:00 +01:00

fixed twitter fallback profile image load failed

instant run ready
This commit is contained in:
Mariotaku Lee 2016-03-18 12:00:40 +08:00
parent c62c58422e
commit 13d87b8d87
10 changed files with 255 additions and 254 deletions

View File

@ -8,7 +8,7 @@ buildscript {
}
dependencies {
classpath 'com.github.ben-manes:gradle-versions-plugin:0.12.0'
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:2.0.0-beta7'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath('fr.avianey.androidsvgdrawable:gradle-plugin:3.0.0') {
// should be excluded to avoid conflict
@ -75,14 +75,6 @@ subprojects {
}
task clean(type: Delete) {
delete(rootProject.buildDir)
}
task wrapper(type: Wrapper) {
gradleVersion = '2.9'
}
def loadSigningConfig(def cfg, def file) {
Properties signingProp = new Properties()
signingProp.load(file.newInputStream())

View File

@ -1,4 +1,4 @@
#Wed Feb 17 21:33:36 CST 2016
#Fri Mar 18 11:41:44 CST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

View File

@ -80,6 +80,37 @@ dependencies {
apt 'com.google.dagger:dagger-compiler:2.1'
apt "com.github.mariotaku.ObjectCursor:processor:0.9.6"
compile('com.github.afollestad.app-theme-engine:library:1.0.2-SNAPSHOT@aar') {
transitive = true
}
compile('com.github.afollestad.material-dialogs:commons:0.8.5.8-SNAPSHOT@aar') {
transitive = true
}
// compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.7'
compile project(':twidere.component.common')
compile project(':twidere.component.nyan')
googleCompile 'com.google.android.gms:play-services-maps:8.4.0'
googleCompile 'com.google.maps.android:android-maps-utils:0.4.3'
googleCompile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') { transitive = true }
googleCompile ':YouTubeAndroidPlayerApi:1.2.2@jar'
fdroidCompile 'org.osmdroid:osmdroid-android:5.1'
debugCompile 'com.facebook.stetho:stetho:1.3.1'
debugCompile 'com.facebook.stetho:stetho-okhttp3:1.3.1'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
provided 'javax.annotation:jsr250-api:1.0'
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support:support-annotations:23.2.1'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-v13:23.2.1'
compile 'com.android.support:appcompat-v7:23.2.1'
@ -87,8 +118,6 @@ dependencies {
compile 'com.android.support:recyclerview-v7:23.2.1'
compile 'com.android.support:preference-v7:23.2.1'
compile 'com.android.support:preference-v14:23.2.1'
compile('com.github.afollestad.app-theme-engine:library:1.0.2-SNAPSHOT@aar') { transitive = true }
compile('com.github.afollestad.material-dialogs:commons:0.8.5.8-SNAPSHOT@aar') { transitive = true }
compile 'com.twitter:twitter-text:1.13.0'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'com.squareup:otto:1.3.8'
@ -97,7 +126,6 @@ dependencies {
compile 'com.commonsware.cwac:layouts:0.4.2'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.pnikosis:materialish-progress:1.7'
// compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.7'
compile 'com.github.johnpersano:supertoasts:1.3.4.1@aar'
compile 'com.github.mariotaku:MessageBubbleView:1.2'
compile 'com.github.mariotaku:DragSortListView:0.6.1'
@ -121,28 +149,6 @@ dependencies {
compile 'com.github.mariotaku.MediaViewerLibrary:subsample-image-view:0.9.13'
compile 'com.github.mariotaku.SQLiteQB:library:0.9.6'
compile 'com.github.mariotaku.ObjectCursor:core:0.9.6'
compile project(':twidere.component.common')
compile project(':twidere.component.nyan')
googleCompile 'com.google.android.gms:play-services-maps:8.4.0'
googleCompile 'com.google.maps.android:android-maps-utils:0.4.3'
googleCompile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') { transitive = true }
googleCompile ':YouTubeAndroidPlayerApi:1.2.2@jar'
fdroidCompile 'org.osmdroid:osmdroid-android:5.1'
debugCompile 'com.facebook.stetho:stetho:1.3.1'
debugCompile 'com.facebook.stetho:stetho-okhttp3:1.3.1'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
provided 'javax.annotation:jsr250-api:1.0'
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support:support-annotations:23.2.1'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
}
task svgToDrawable(type: SvgDrawableTask) {

View File

@ -1,69 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
package="org.mariotaku.twidere"
xmlns:android="http://schemas.android.com/apk/res/android"
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto">
package="org.mariotaku.twidere"
android:installLocation="auto" >
<uses-sdk/>
<uses-sdk />
<uses-feature
android:name="android.hardware.camera"
android:required="false"/>
android:required="false" />
<uses-feature
android:name="android.hardware.location"
android:required="false"/>
android:required="false" />
<uses-feature
android:name="android.hardware.location.gps"
android:required="false"/>
android:required="false" />
<uses-feature
android:name="android.hardware.location.network"
android:required="false"/>
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false"/>
android:required="false" />
<uses-feature
android:name="android.hardware.nfc"
android:required="false"/>
android:required="false" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.NFC"/>
<uses-permission android:name="org.mariotaku.twidere.permission.SHORTEN_STATUS"/>
<uses-permission android:name="org.mariotaku.twidere.permission.UPLOAD_MEDIA"/>
<uses-permission android:name="org.mariotaku.twidere.permission.SYNC_TIMELINE"/>
android:required="true" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="org.mariotaku.twidere.permission.SHORTEN_STATUS" />
<uses-permission android:name="org.mariotaku.twidere.permission.UPLOAD_MEDIA" />
<uses-permission android:name="org.mariotaku.twidere.permission.SYNC_TIMELINE" />
<uses-permission
android:name="android.permission.READ_PHONE_STATE"
tools:node="remove"/>
tools:node="remove" />
<permission-group
android:name="org.mariotaku.twidere.permission.PERMISSION_GROUP"
android:label="@string/app_name"/>
android:label="@string/app_name" />
<permission
android:name="org.mariotaku.twidere.permission.SHORTEN_STATUS"
android:description="@string/permission_description_shorten_status"
android:label="@string/permission_label_shorten_status"
android:permissionGroup="org.mariotaku.twidere.permission.PERMISSION_GROUP"/>
android:permissionGroup="org.mariotaku.twidere.permission.PERMISSION_GROUP" />
<permission
android:name="org.mariotaku.twidere.permission.UPLOAD_MEDIA"
android:description="@string/permission_description_upload_media"
android:label="@string/permission_label_upload_media"
android:permissionGroup="org.mariotaku.twidere.permission.PERMISSION_GROUP"/>
android:permissionGroup="org.mariotaku.twidere.permission.PERMISSION_GROUP" />
<permission
android:name="org.mariotaku.twidere.permission.SYNC_TIMELINE"
android:description="@string/permission_description_sync_timeline"
android:label="@string/permission_label_sync_timeline"
android:permissionGroup="org.mariotaku.twidere.permission.PERMISSION_GROUP"/>
android:permissionGroup="org.mariotaku.twidere.permission.PERMISSION_GROUP" />
<application
android:name=".app.TwidereApplication"
@ -76,36 +74,35 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.Twidere.NoActionBar"
tools:ignore="UnusedAttribute">
tools:ignore="UnusedAttribute" >
<uses-library
android:name="com.sec.android.app.multiwindow"
android:required="false"/>
android:required="false" />
<meta-data
android:name="io.fabric.ApiKey"
android:value="dc4ee756d3b705e00011782f1426fc8656ad3bd9"/>
android:value="dc4ee756d3b705e00011782f1426fc8656ad3bd9" />
<meta-data
android:name="com.google.android.backup.api_key"
android:value="AEdPqrEAAAAIKbKATV1AGbLB4kem3w8QaPVJSPVVumbMHxkfwA"/>
android:value="AEdPqrEAAAAIKbKATV1AGbLB4kem3w8QaPVJSPVVumbMHxkfwA" />
<meta-data
android:name="com.sec.android.support.multiwindow"
android:value="true"/>
android:value="true" />
<meta-data
android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W"
android:value="480dp"/>
android:value="480dp" />
<meta-data
android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H"
android:value="640dp"/>
android:value="640dp" />
<meta-data
android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W"
android:value="240dp"/>
android:value="240dp" />
<meta-data
android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H"
android:value="320dp"/>
android:value="320dp" />
<meta-data
android:name="override_tinted_status_bar_defaults"
android:value="true"/>
android:value="true" />
<activity
android:name=".activity.MainActivity"
@ -113,13 +110,13 @@
android:label="@string/app_name"
android:launchMode="singleTop"
android:theme="@style/Theme.Twidere.NoActionBar"
android:windowSoftInputMode="adjustNothing">
android:windowSoftInputMode="adjustNothing" >
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
@ -129,13 +126,13 @@
android:label="@string/app_name"
android:launchMode="singleTop"
android:theme="@style/Theme.Twidere.NoActionBar"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize" >
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
@ -143,24 +140,24 @@
android:label="@string/app_name"
android:launchMode="singleTop"
android:theme="@style/Theme.Twidere.NoActionBar"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize" >
<intent-filter>
<action android:name="org.mariotaku.twidere.HOME"/>
<action android:name="org.mariotaku.twidere.HOME" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH"/>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable"/>
android:resource="@xml/searchable" />
<meta-data
android:name="android.app.default_searchable"
android:value=".activity.support.HomeActivity"/>
android:value=".activity.support.HomeActivity" />
</activity>
<activity
android:name=".activity.ComposeActivity"
@ -169,64 +166,64 @@
android:launchMode="singleTop"
android:parentActivityName=".activity.HomeActivity"
android:theme="@style/Theme.Twidere.Compose"
android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/compose">
<action android:name="android.intent.action.MAIN"/>
<action android:name="org.mariotaku.twidere.COMPOSE"/>
<action android:name="org.mariotaku.twidere.REPLY"/>
<action android:name="org.mariotaku.twidere.QUOTE"/>
<action android:name="org.mariotaku.twidere.EDIT_DRAFT"/>
<action android:name="org.mariotaku.twidere.MENTION"/>
<action android:name="org.mariotaku.twidere.REPLY_MULTIPLE"/>
android:windowSoftInputMode="adjustResize" >
<intent-filter android:label="@string/compose" >
<action android:name="android.intent.action.MAIN" />
<action android:name="org.mariotaku.twidere.COMPOSE" />
<action android:name="org.mariotaku.twidere.REPLY" />
<action android:name="org.mariotaku.twidere.QUOTE" />
<action android:name="org.mariotaku.twidere.EDIT_DRAFT" />
<action android:name="org.mariotaku.twidere.MENTION" />
<action android:name="org.mariotaku.twidere.REPLY_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.SEND"/>
<action android:name="android.intent.action.SEND_MULTIPLE"/>
<intent-filter android:label="@string/app_name" >
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*"/>
<data android:mimeType="text/plain"/>
<data android:mimeType="image/*" />
<data android:mimeType="text/plain" />
</intent-filter>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.HomeActivity"/>
android:value=".activity.HomeActivity" />
</activity>
<activity
android:name=".activity.QuickSearchBarActivity"
android:label="@string/search"
android:launchMode="singleTop"
android:theme="@style/Theme.Twidere.QuickSearchBar"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize" >
<intent-filter>
<action android:name="org.mariotaku.twidere.GLOBAL_SEARCH"/>
<action android:name="org.mariotaku.twidere.GLOBAL_SEARCH" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activity.SignInActivity"
android:label="@string/sign_in"
android:theme="@style/Theme.Twidere"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize" >
<intent-filter>
<action android:name="org.mariotaku.twidere.TWITTER_LOGIN"/>
<action android:name="org.mariotaku.twidere.TWITTER_LOGIN" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activity.BrowserSignInActivity"
android:label="@string/browser_sign_in"
android:theme="@style/Theme.Twidere"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize" >
<intent-filter>
<action android:name="org.mariotaku.twidere.TWITTER_BROWSER_LOGIN"/>
<action android:name="org.mariotaku.twidere.TWITTER_BROWSER_LOGIN" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
@ -234,53 +231,53 @@
android:label="@string/settings"
android:parentActivityName=".activity.HomeActivity"
android:theme="@style/Theme.Twidere"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize" >
<intent-filter>
<action android:name="android.intent.action.MANAGE_NETWORK_USAGE"/>
<action android:name="org.mariotaku.twidere.SETTINGS"/>
<action android:name="android.intent.action.MANAGE_NETWORK_USAGE" />
<action android:name="org.mariotaku.twidere.SETTINGS" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.HomeActivity"/>
android:value=".activity.HomeActivity" />
</activity>
<activity
android:name=".activity.APIEditorActivity"
android:label="@string/edit_api"
android:theme="@style/Theme.Twidere.Dialog"
android:windowSoftInputMode="adjustResize"/>
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".activity.AccountSelectorActivity"
android:label="@string/select_account"
android:theme="@style/Theme.Twidere.Dialog">
android:theme="@style/Theme.Twidere.Dialog" >
<intent-filter>
<action android:name="org.mariotaku.twidere.SELECT_ACCOUNT"/>
<action android:name="org.mariotaku.twidere.SELECT_ACCOUNT" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activity.ColorPickerDialogActivity"
android:label="@string/set_color"
android:theme="@style/Theme.Twidere.NoDisplay"/>
android:theme="@style/Theme.Twidere.NoDisplay" />
<activity
android:name=".activity.LinkHandlerActivity"
android:parentActivityName=".activity.HomeActivity"
android:theme="@style/Theme.Twidere"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.HomeActivity"/>
android:value=".activity.HomeActivity" />
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="twidere"/>
<data android:scheme="twidere" />
</intent-filter>
</activity>
<activity
@ -288,21 +285,20 @@
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/media"
android:theme="@style/Theme.Twidere.Viewer"
android:windowSoftInputMode="adjustPan">
android:windowSoftInputMode="adjustPan" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.HomeActivity"/>
android:value=".activity.HomeActivity" />
<intent-filter>
<action android:name="org.mariotaku.twidere.VIEW_MEDIA"/>
<action android:name="org.mariotaku.twidere.VIEW_MEDIA" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/>
<data android:scheme="https"/>
<data android:scheme="file"/>
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="file" />
</intent-filter>
</activity>
<activity
@ -310,25 +306,25 @@
android:exported="false"
android:label="@string/pick_file"
android:theme="@style/Theme.Twidere.NoDisplay"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize" >
<intent-filter>
<action android:name="org.mariotaku.twidere.PICK_FILE"/>
<action android:name="org.mariotaku.twidere.PICK_DIRECTORY"/>
<action android:name="org.mariotaku.twidere.PICK_FILE" />
<action android:name="org.mariotaku.twidere.PICK_DIRECTORY" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activity.ThemedImagePickerActivity"
android:exported="false"
android:theme="@style/Theme.Twidere.NoDisplay"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize" >
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="org.mariotaku.twidere.PICK_IMAGE"/>
<action android:name="org.mariotaku.twidere.TAKE_PHOTO"/>
<action android:name="android.intent.action.MAIN" />
<action android:name="org.mariotaku.twidere.PICK_IMAGE" />
<action android:name="org.mariotaku.twidere.TAKE_PHOTO" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
@ -336,106 +332,106 @@
android:exported="false"
android:label="@string/add_tab"
android:theme="@style/Theme.Twidere.Dialog"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize" >
<intent-filter>
<action android:name="org.mariotaku.twidere.ADD_TAB"/>
<action android:name="org.mariotaku.twidere.EDIT_TAB"/>
<action android:name="org.mariotaku.twidere.ADD_TAB" />
<action android:name="org.mariotaku.twidere.EDIT_TAB" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activity.CreateComposeShortcutActivity"
android:label="@string/compose"
android:theme="@style/Theme.Twidere.NoDisplay">
android:theme="@style/Theme.Twidere.NoDisplay" >
<intent-filter>
<action android:name="android.intent.action.CREATE_SHORTCUT"/>
<action android:name="android.intent.action.CREATE_SHORTCUT" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activity.CopyLinkActivity"
android:label="@string/copy_link"
android:theme="@style/Theme.Twidere.NoDisplay"/>
android:theme="@style/Theme.Twidere.NoDisplay" />
<activity
android:name=".activity.RequestPermissionsActivity"
android:label="@string/permissions_request"
android:theme="@style/Theme.Twidere.Dialog">
android:theme="@style/Theme.Twidere.Dialog" >
<intent-filter>
<action android:name="org.mariotaku.twidere.REQUEST_PERMISSIONS"/>
<action android:name="org.mariotaku.twidere.REQUEST_PERMISSIONS" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activity.UserListSelectorActivity"
android:label="@string/select_user_list"
android:theme="@style/Theme.Twidere.Dialog">
android:theme="@style/Theme.Twidere.Dialog" >
<intent-filter>
<action android:name="org.mariotaku.twidere.SELECT_USER"/>
<action android:name="org.mariotaku.twidere.SELECT_USER_LIST"/>
<action android:name="org.mariotaku.twidere.SELECT_USER" />
<action android:name="org.mariotaku.twidere.SELECT_USER_LIST" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activity.SettingsWizardActivity"
android:label="@string/settings_wizard"
android:theme="@style/Theme.Twidere.NoActionBar"/>
android:theme="@style/Theme.Twidere.NoActionBar" />
<activity
android:name=".activity.DataExportActivity"
android:label="@string/export_settings"
android:theme="@style/Theme.Twidere.NoDisplay"/>
android:theme="@style/Theme.Twidere.NoDisplay" />
<activity
android:name=".activity.DataImportActivity"
android:label="@string/import_settings"
android:theme="@style/Theme.Twidere.NoDisplay"/>
android:theme="@style/Theme.Twidere.NoDisplay" />
<activity
android:name=".activity.ActivityPickerActivity"
android:theme="@style/Theme.Twidere.Dialog">
android:theme="@style/Theme.Twidere.Dialog" >
<intent-filter>
<action android:name="org.mariotaku.twidere.PICK_ACTIVITY"/>
<action android:name="org.mariotaku.twidere.PICK_ACTIVITY" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".activity.TwitterLinkHandlerActivity"
android:excludeFromRecents="true"
android:taskAffinity=":twidere_twitter_link_handler"
android:theme="@style/Theme.Twidere.NoDisplay">
android:theme="@style/Theme.Twidere.NoDisplay" >
<intent-filter>
<data
android:host="twitter.com"
android:pathPrefix="/"
android:scheme="http"/>
android:scheme="http" />
<data
android:host="twitter.com"
android:pathPrefix="/"
android:scheme="https"/>
android:scheme="https" />
<data
android:host="www.twitter.com"
android:pathPrefix="/"
android:scheme="http"/>
android:scheme="http" />
<data
android:host="www.twitter.com"
android:pathPrefix="/"
android:scheme="https"/>
android:scheme="https" />
<data
android:host="mobile.twitter.com"
android:pathPrefix="/"
android:scheme="http"/>
android:scheme="http" />
<data
android:host="mobile.twitter.com"
android:pathPrefix="/"
android:scheme="https"/>
android:scheme="https" />
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
<activity
@ -443,56 +439,56 @@
android:enabled="false"
android:excludeFromRecents="true"
android:taskAffinity=":twidere_assist_launcher"
android:theme="@style/Theme.Twidere.NoDisplay">
android:theme="@style/Theme.Twidere.NoDisplay" >
<intent-filter>
<action android:name="android.intent.action.ASSIST"/>
<action android:name="android.intent.action.ASSIST" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="com.android.systemui.action_assist_icon"
android:resource="@drawable/ic_assist_twidere"/>
android:resource="@drawable/ic_assist_twidere" />
</activity>
<activity
android:name=".activity.KeyboardShortcutPreferenceCompatActivity"
android:theme="@style/Theme.Twidere.Dialog"/>
android:theme="@style/Theme.Twidere.Dialog" />
<activity
android:name=".activity.TestActivity"
android:enabled="false"
android:label="Twidere test"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize" >
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activity.NyanActivity"
android:launchMode="singleTop"
android:theme="@style/Theme.Nyan"
android:windowSoftInputMode="stateAlwaysHidden"/>
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name=".activity.UsageStatisticsActivity"
android:label="@string/usage_statistics"
android:theme="@style/Theme.Twidere.NoDisplay"/>
android:theme="@style/Theme.Twidere.NoDisplay" />
<activity
android:name=".activity.ImageCropperActivity"
android:label="@string/crop_image"
android:theme="@style/Theme.Twidere.NoActionBar"
android:windowSoftInputMode="adjustResize"/>
android:windowSoftInputMode="adjustResize" />
<service
android:name=".service.RefreshService"
android:label="@string/label_refresh_service"/>
android:label="@string/label_refresh_service" />
<service
android:name=".service.StreamingService"
android:label="@string/label_streaming_service"/>
android:label="@string/label_streaming_service" />
<service
android:name=".service.BackgroundOperationService"
android:label="@string/label_background_operation_service"/>
android:label="@string/label_background_operation_service" />
<service
android:name=".nyan.NyanWallpaperService"
android:enabled="false"
@ -500,14 +496,14 @@
android:icon="@drawable/nyan_sakamoto_thumbnail"
android:label="@string/nyan_sakamoto"
android:permission="android.permission.BIND_WALLPAPER"
android:process=":wallpaper">
<intent-filter android:priority="1">
<action android:name="android.service.wallpaper.WallpaperService"/>
android:process=":wallpaper" >
<intent-filter android:priority="1" >
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data
android:name="android.service.wallpaper"
android:resource="@xml/nyan_wallpaper"/>
android:resource="@xml/nyan_wallpaper" />
</service>
<service
android:name=".nyan.NyanDaydreamService"
@ -516,12 +512,12 @@
android:icon="@drawable/nyan_sakamoto_thumbnail"
android:label="@string/nyan_sakamoto"
android:process=":daydream"
tools:ignore="ExportedService">
<intent-filter android:priority="1">
<action android:name="android.service.dreams.DreamService"/>
tools:ignore="ExportedService" >
<intent-filter android:priority="1" >
<action android:name="android.service.dreams.DreamService" />
</intent-filter>
</service>
<service android:name="edu.tsinghua.hotmobi.UploadLogsService"/>
<service android:name="edu.tsinghua.hotmobi.UploadLogsService" />
<provider
android:name=".provider.TwidereDataProvider"
@ -529,57 +525,56 @@
android:exported="true"
android:grantUriPermissions="true"
android:label="@string/label_data_provider"
tools:ignore="ExportedContentProvider"/>
tools:ignore="ExportedContentProvider" />
<provider
android:name=".provider.RecentSearchProvider"
android:authorities="org.mariotaku.twidere.provider.SearchRecentSuggestions"
tools:ignore="ExportedContentProvider"/>
tools:ignore="ExportedContentProvider" />
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="twidere.file"
android:exported="false"
android:grantUriPermissions="true">
android:grantUriPermissions="true" >
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"/>
android:resource="@xml/file_paths" />
</provider>
<provider
android:name=".provider.CacheProvider"
android:authorities="twidere.cache"
android:exported="false"/>
android:exported="false" />
<receiver android:name=".receiver.ConnectivityStateReceiver">
<receiver android:name=".receiver.ConnectivityStateReceiver" >
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
</receiver>
<receiver
android:name=".receiver.NotificationReceiver"
android:exported="false">
android:exported="false" >
<intent-filter>
<action android:name="org.mariotaku.twidere.NOTIFICATION_DELETED"/>
<action android:name="org.mariotaku.twidere.NOTIFICATION_DELETED" />
</intent-filter>
</receiver>
<receiver
android:name=".receiver.SecretCodeBroadcastReceiver"
android:label="@string/twidere_test">
android:label="@string/twidere_test" >
<intent-filter>
<action android:name="android.provider.Telephony.SECRET_CODE"/>
<action android:name="android.provider.Telephony.SECRET_CODE" />
<data
android:host="8943373"
android:scheme="android_secret_code"/>
android:scheme="android_secret_code" />
</intent-filter>
</receiver>
<receiver android:name=".receiver.PowerStateReceiver">
<receiver android:name=".receiver.PowerStateReceiver" >
<intent-filter>
<action android:name="android.intent.action.BATTERY_LOW"/>
<action android:name="android.intent.action.BATTERY_OKAY"/>
<action android:name="android.intent.action.ACTION_POWER_CONNECTED"/>
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/>
<action android:name="android.intent.action.BATTERY_LOW" />
<action android:name="android.intent.action.BATTERY_OKAY" />
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
</intent-filter>
</receiver>
</application>
</manifest>
</manifest>

View File

@ -14,7 +14,6 @@ import org.mariotaku.twidere.Constants;
import org.mariotaku.twidere.R;
import org.mariotaku.twidere.activity.ComposeActivity;
import org.mariotaku.twidere.activity.QuickSearchBarActivity;
import org.mariotaku.twidere.app.TwidereApplication;
import org.mariotaku.twidere.constant.KeyboardShortcutConstants;
import java.util.HashMap;
@ -64,8 +63,9 @@ public class KeyboardShortcutsHandler implements Constants, KeyboardShortcutCons
private final SharedPreferencesWrapper mPreferences;
public KeyboardShortcutsHandler(final TwidereApplication context) {
mPreferences = SharedPreferencesWrapper.getInstance(context, KEYBOARD_SHORTCUTS_PREFERENCES_NAME, Context.MODE_PRIVATE);
public KeyboardShortcutsHandler(final Context context) {
mPreferences = SharedPreferencesWrapper.getInstance(context,
KEYBOARD_SHORTCUTS_PREFERENCES_NAME, Context.MODE_PRIVATE);
}
public String findAction(@NonNull KeyboardShortcutSpec spec) {

View File

@ -19,12 +19,11 @@
package org.mariotaku.twidere.util;
import android.app.Application;
import android.app.Notification;
import android.app.NotificationManager;
import android.content.Context;
import org.mariotaku.twidere.app.TwidereApplication;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
@ -36,8 +35,8 @@ public class NotificationManagerWrapper {
private final NotificationManager notificationManager;
private final List<PostedNotification> notifications = new CopyOnWriteArrayList<>();
public NotificationManagerWrapper(TwidereApplication application) {
notificationManager = (NotificationManager) application.getSystemService(Context.NOTIFICATION_SERVICE);
public NotificationManagerWrapper(Context context) {
notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
}
public void notify(String tag, int id, Notification notification) {

View File

@ -19,6 +19,7 @@
package org.mariotaku.twidere.util.dagger;
import android.app.Application;
import android.content.Context;
import android.os.Looper;
import android.support.annotation.NonNull;
@ -39,7 +40,6 @@ import org.mariotaku.mediaviewer.library.MediaDownloader;
import org.mariotaku.restfu.http.RestHttpClient;
import org.mariotaku.twidere.BuildConfig;
import org.mariotaku.twidere.Constants;
import org.mariotaku.twidere.app.TwidereApplication;
import org.mariotaku.twidere.constant.SharedPreferenceConstants;
import org.mariotaku.twidere.util.ActivityTracker;
import org.mariotaku.twidere.util.AsyncTaskManager;
@ -83,9 +83,11 @@ import static org.mariotaku.twidere.util.Utils.getInternalCacheDir;
@Module
public class ApplicationModule implements Constants {
private final TwidereApplication application;
private static ApplicationModule sApplicationModule;
public ApplicationModule(TwidereApplication application) {
private final Application application;
public ApplicationModule(Application application) {
if (Thread.currentThread() != Looper.getMainLooper().getThread()) {
throw new RuntimeException("Module must be created inside main thread");
}
@ -93,7 +95,9 @@ public class ApplicationModule implements Constants {
}
static ApplicationModule get(@NonNull Context context) {
return TwidereApplication.getInstance(context).getApplicationModule();
if (sApplicationModule != null) return sApplicationModule;
Application application = (Application) context.getApplicationContext();
return sApplicationModule = new ApplicationModule(application);
}
@Provides

View File

@ -49,14 +49,13 @@ public class TwidereImageDownloader extends BaseImageDownloader implements Const
}
@Override
protected InputStream getStreamFromNetwork(final String uriString, final Object extras) throws IOException {
protected InputStream getStreamFromNetwork(String uriString, final Object extras) throws IOException {
if (uriString == null) return null;
try {
if (isTwitterProfileImage(uriString)) {
final String replaced = Utils.getTwitterProfileImageOfSize(uriString, mTwitterProfileImageSize);
return getStreamFromNetworkInternal(replaced, extras);
} else
return getStreamFromNetworkInternal(uriString, extras);
uriString = Utils.getTwitterProfileImageOfSize(uriString, mTwitterProfileImageSize);
}
return getStreamFromNetworkInternal(uriString, extras);
} catch (final FileNotFoundException e) {
if (isTwitterProfileImage(uriString) && !uriString.contains("_normal.")) {
return getStreamFromNetworkInternal(Utils.getNormalTwitterProfileImage(uriString), extras);

View File

@ -37,6 +37,7 @@ import org.mariotaku.twidere.util.UserAgentUtils;
import org.mariotaku.twidere.util.media.preview.PreviewMediaExtractor;
import org.mariotaku.twidere.util.net.NoIntercept;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
@ -162,7 +163,12 @@ public class TwidereMediaDownloader implements MediaDownloader, Constants {
builder.tag(NoIntercept.INSTANCE);
final HttpResponse resp = mClient.newCall(builder.build()).execute();
if (!resp.isSuccessful()) {
throw new IOException("Unable to get media, response code: " + resp.getStatus());
final String detailMessage = "Unable to get " + requestUri + ", response code: "
+ resp.getStatus();
if (resp.getStatus() == 404) {
throw new FileNotFoundException(detailMessage);
}
throw new IOException(detailMessage);
}
final Body body = resp.getBody();
final CacheMetadata metadata = new CacheMetadata();

View File

@ -19,6 +19,7 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -26,11 +27,10 @@
android:orientation="horizontal"
tools:layout_height="?actionBarSize">
<Spinner
<android.support.v7.widget.AppCompatSpinner
android:id="@+id/account_spinner"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="@dimen/element_spacing_small"
android:tag="tint|primary_color_dependent"
tools:listitem="@layout/spinner_item_account_icon"/>
@ -38,8 +38,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toEndOf="@+id/account_spinner"
android:layout_toRightOf="@+id/account_spinner"
android:padding="@dimen/element_spacing_small">
android:layout_toRightOf="@+id/account_spinner">
<EditText
android:id="@+id/user_query"
@ -47,23 +46,24 @@
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/element_spacing_normal"
android:layout_marginRight="@dimen/element_spacing_normal"
android:gravity="bottom"
android:gravity="bottom|center_vertical"
android:inputType="textPersonName|textMultiLine"
android:tag="background|primary_color_dependent">
android:tag="tint|primary_color_dependent,text_color|primary_color_dependent">
<requestFocus/>
</EditText>
<org.mariotaku.twidere.view.themed.BackgroundTintImageButton
<android.support.v7.widget.AppCompatImageButton
android:id="@+id/query_button"
style="?cardActionButtonStyle"
style="?actionButtonStyle"
android:layout_width="@dimen/element_size_normal"
android:layout_height="@dimen/element_size_normal"
android:layout_gravity="end"
android:color="?android:textColorPrimary"
android:padding="@dimen/element_spacing_normal"
android:layout_gravity="end|center_vertical"
android:contentDescription="@string/search"
android:scaleType="centerInside"
android:src="@drawable/ic_action_search"/>
android:src="@drawable/ic_action_search"
android:tag="tint|primary_color_dependent"
app:backgroundTintMode="src_atop"/>
</FrameLayout>
</RelativeLayout>