mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-02-17 04:00:48 +01:00
fixed profile image background shape in lollipop
added unsupported message for send image to buffer
This commit is contained in:
parent
26bcfde9d2
commit
17418bebf8
@ -26,6 +26,7 @@ import org.mariotaku.microblog.library.twitter.api.FavoritesResources;
|
||||
import org.mariotaku.microblog.library.twitter.api.FriendsFollowersResources;
|
||||
import org.mariotaku.microblog.library.twitter.api.HelpResources;
|
||||
import org.mariotaku.microblog.library.twitter.api.ListResources;
|
||||
import org.mariotaku.microblog.library.twitter.api.MutesResources;
|
||||
import org.mariotaku.microblog.library.twitter.api.PlacesGeoResources;
|
||||
import org.mariotaku.microblog.library.twitter.api.SavedSearchesResources;
|
||||
import org.mariotaku.microblog.library.twitter.api.SearchResources;
|
||||
@ -41,5 +42,5 @@ import org.mariotaku.microblog.library.twitter.api.UsersResources;
|
||||
public interface Twitter extends SearchResources, TimelineResources, TweetResources, UsersResources,
|
||||
ListResources, DirectMessagesResources, FriendsFollowersResources, FavoritesResources,
|
||||
SpamReportingResources, SavedSearchesResources, TrendsResources, PlacesGeoResources,
|
||||
HelpResources, TwitterPrivate {
|
||||
HelpResources, MutesResources, TwitterPrivate {
|
||||
}
|
||||
|
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Twidere - Twitter client for Android
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.mariotaku.microblog.library.twitter.api;
|
||||
|
||||
import org.mariotaku.microblog.library.MicroBlogException;
|
||||
import org.mariotaku.microblog.library.twitter.model.IDs;
|
||||
import org.mariotaku.microblog.library.twitter.model.PageableResponseList;
|
||||
import org.mariotaku.microblog.library.twitter.model.Paging;
|
||||
import org.mariotaku.microblog.library.twitter.model.User;
|
||||
import org.mariotaku.microblog.library.twitter.template.UserAnnotationTemplate;
|
||||
import org.mariotaku.restfu.annotation.method.GET;
|
||||
import org.mariotaku.restfu.annotation.method.POST;
|
||||
import org.mariotaku.restfu.annotation.param.Param;
|
||||
import org.mariotaku.restfu.annotation.param.Queries;
|
||||
import org.mariotaku.restfu.annotation.param.Query;
|
||||
|
||||
/**
|
||||
* Created by mariotaku on 2017/3/26.
|
||||
*/
|
||||
@Queries(template = UserAnnotationTemplate.class)
|
||||
public interface MutesResources {
|
||||
|
||||
@POST("/mutes/users/create.json")
|
||||
User createMute(@Param("user_id") String userId) throws MicroBlogException;
|
||||
|
||||
@POST("/mutes/users/create.json")
|
||||
User createMuteByScreenName(@Query("screen_name") String screenName) throws MicroBlogException;
|
||||
|
||||
@POST("/mutes/users/destroy.json")
|
||||
User destroyMute(@Param("user_id") String userId) throws MicroBlogException;
|
||||
|
||||
@POST("/mutes/users/destroy.json")
|
||||
User destroyMuteByScreenName(@Query("screen_name") String screenName) throws MicroBlogException;
|
||||
|
||||
@GET("/mutes/users/ids.json")
|
||||
IDs getMutesUsersIDs(Paging paging) throws MicroBlogException;
|
||||
|
||||
@GET("/mutes/users/list.json")
|
||||
PageableResponseList<User> getMutesUsersList(@Query Paging paging) throws MicroBlogException;
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Twidere - Twitter client for Android
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.mariotaku.microblog.library.twitter.api;
|
||||
|
||||
import org.mariotaku.microblog.library.MicroBlogException;
|
||||
import org.mariotaku.microblog.library.twitter.model.IDs;
|
||||
import org.mariotaku.microblog.library.twitter.model.MutedKeyword;
|
||||
import org.mariotaku.microblog.library.twitter.model.PageableResponseList;
|
||||
import org.mariotaku.microblog.library.twitter.model.Paging;
|
||||
import org.mariotaku.microblog.library.twitter.template.UserAnnotationTemplate;
|
||||
import org.mariotaku.restfu.annotation.method.GET;
|
||||
import org.mariotaku.restfu.annotation.param.Queries;
|
||||
import org.mariotaku.restfu.annotation.param.Query;
|
||||
|
||||
/**
|
||||
* Created by mariotaku on 2017/3/26.
|
||||
*/
|
||||
@Queries(template = UserAnnotationTemplate.class)
|
||||
public interface PrivateMutesResources {
|
||||
|
||||
@GET("/mutes/keywords/ids.json")
|
||||
IDs getMutesKeywordsIDs(Paging paging) throws MicroBlogException;
|
||||
|
||||
@GET("/mutes/keywords/list.json")
|
||||
PageableResponseList<MutedKeyword> getMutesKeywordsList(@Query Paging paging) throws MicroBlogException;
|
||||
}
|
@ -51,11 +51,6 @@ public interface UsersResources {
|
||||
@POST("/blocks/create.json")
|
||||
User createBlockByScreenName(@Query("screen_name") String screenName) throws MicroBlogException;
|
||||
|
||||
@POST("/mutes/users/create.json")
|
||||
User createMute(@Param("user_id") String userId) throws MicroBlogException;
|
||||
|
||||
@POST("/mutes/users/create.json")
|
||||
User createMuteByScreenName(@Query("screen_name") String screenName) throws MicroBlogException;
|
||||
|
||||
@POST("/blocks/destroy.json")
|
||||
User destroyBlock(@Param("user_id") String userId) throws MicroBlogException;
|
||||
@ -63,11 +58,6 @@ public interface UsersResources {
|
||||
@POST("/blocks/destroy.json")
|
||||
User destroyBlockByScreenName(@Query("screen_name") String screenName) throws MicroBlogException;
|
||||
|
||||
@POST("/mutes/users/destroy.json")
|
||||
User destroyMute(@Param("user_id") String userId) throws MicroBlogException;
|
||||
|
||||
@POST("/mutes/users/destroy.json")
|
||||
User destroyMuteByScreenName(@Query("screen_name") String screenName) throws MicroBlogException;
|
||||
|
||||
@GET("/account/settings.json")
|
||||
AccountSettings getAccountSettings() throws MicroBlogException;
|
||||
@ -80,11 +70,6 @@ public interface UsersResources {
|
||||
|
||||
ResponseList<User> getMemberSuggestions(String categorySlug) throws MicroBlogException;
|
||||
|
||||
@GET("/mutes/users/ids.json")
|
||||
IDs getMutesUsersIDs(Paging paging) throws MicroBlogException;
|
||||
|
||||
@GET("/mutes/users/list.json")
|
||||
PageableResponseList<User> getMutesUsersList(@Query Paging paging) throws MicroBlogException;
|
||||
|
||||
ResponseList<Category> getSuggestedUserCategories() throws MicroBlogException;
|
||||
|
||||
|
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Twidere - Twitter client for Android
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.mariotaku.microblog.library.twitter.model;
|
||||
|
||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
||||
|
||||
/**
|
||||
* Created by mariotaku on 2017/3/26.
|
||||
*/
|
||||
@JsonObject
|
||||
public class MutedKeyword {
|
||||
}
|
@ -119,12 +119,8 @@ public class ShapedImageView extends AppCompatImageView {
|
||||
}
|
||||
|
||||
public void setShapeBackground(final int color) {
|
||||
if (OUTLINE_DRAW) {
|
||||
setBackgroundColor(color);
|
||||
} else {
|
||||
mBackgroundPaint.setColor(color);
|
||||
invalidate();
|
||||
}
|
||||
mBackgroundPaint.setColor(color);
|
||||
invalidate();
|
||||
}
|
||||
|
||||
public int[] getBorderColors() {
|
||||
@ -193,15 +189,17 @@ public class ShapedImageView extends AppCompatImageView {
|
||||
mDestination.set(getPaddingLeft(), getPaddingTop(), getWidth() - getPaddingRight(),
|
||||
getHeight() - getPaddingBottom());
|
||||
|
||||
final int contentLeft = getPaddingLeft(), contentTop = getPaddingTop(),
|
||||
contentRight = getWidth() - getPaddingRight(),
|
||||
contentBottom = getHeight() - getPaddingBottom();
|
||||
final int contentWidth = contentRight - contentLeft,
|
||||
contentHeight = contentBottom - contentTop;
|
||||
final int size = Math.min(contentWidth, contentHeight);
|
||||
|
||||
if (OUTLINE_DRAW) {
|
||||
drawShape(canvas, mDestination, 0, mBackgroundPaint);
|
||||
super.onDraw(canvas);
|
||||
} else {
|
||||
final int contentLeft = getPaddingLeft(), contentTop = getPaddingTop(),
|
||||
contentRight = getWidth() - getPaddingRight(),
|
||||
contentBottom = getHeight() - getPaddingBottom();
|
||||
final int contentWidth = contentRight - contentLeft,
|
||||
contentHeight = contentBottom - contentTop;
|
||||
final int size = Math.min(contentWidth, contentHeight);
|
||||
if (mShadowBitmap != null && mDrawShadow) {
|
||||
canvas.drawBitmap(mShadowBitmap, contentLeft + (contentWidth - size) / 2 - mShadowRadius,
|
||||
contentTop + (contentHeight - size) / 2 - mShadowRadius, null);
|
||||
|
@ -262,7 +262,7 @@ class UpdateStatusTask(
|
||||
throw SchedulerNotFoundException("No scheduler found")
|
||||
}
|
||||
|
||||
controller.scheduleStatus(statusUpdate, pendingUpdate.overrideTexts, scheduleInfo)
|
||||
controller.scheduleStatus(statusUpdate, pendingUpdate, scheduleInfo)
|
||||
|
||||
return UpdateStatusResult(pendingUpdate.length, draftId)
|
||||
}
|
||||
@ -499,9 +499,9 @@ class UpdateStatusTask(
|
||||
}
|
||||
}
|
||||
|
||||
internal class PendingStatusUpdate(val length: Int, defaultText: String) {
|
||||
class PendingStatusUpdate internal constructor(val length: Int, defaultText: String) {
|
||||
|
||||
constructor(statusUpdate: ParcelableStatusUpdate) : this(statusUpdate.accounts.size,
|
||||
internal constructor(statusUpdate: ParcelableStatusUpdate) : this(statusUpdate.accounts.size,
|
||||
statusUpdate.text)
|
||||
|
||||
var sharedMediaIds: Array<String>? = null
|
||||
|
@ -25,6 +25,7 @@ import android.support.annotation.WorkerThread
|
||||
import org.mariotaku.twidere.model.ParcelableStatusUpdate
|
||||
import org.mariotaku.twidere.model.schedule.ScheduleInfo
|
||||
import org.mariotaku.twidere.task.twitter.UpdateStatusTask
|
||||
import org.mariotaku.twidere.task.twitter.UpdateStatusTask.PendingStatusUpdate
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
@ -35,7 +36,7 @@ interface StatusScheduleController {
|
||||
|
||||
@WorkerThread
|
||||
@Throws(UpdateStatusTask.ScheduleException::class)
|
||||
fun scheduleStatus(statusUpdate: ParcelableStatusUpdate, overrideTexts: Array<String>,
|
||||
fun scheduleStatus(statusUpdate: ParcelableStatusUpdate, pendingUpdate: PendingStatusUpdate,
|
||||
scheduleInfo: ScheduleInfo)
|
||||
|
||||
fun createSetScheduleIntent(): Intent
|
||||
|
@ -7,13 +7,13 @@
|
||||
<item
|
||||
android:id="@+id/add_media"
|
||||
android:icon="@drawable/ic_action_gallery"
|
||||
android:title="@string/add_image"
|
||||
android:title="@string/action_add_media"
|
||||
app:showAsAction="always"
|
||||
tools:ignore="AlwaysShowAction"/>
|
||||
<item
|
||||
android:id="@+id/media_menu"
|
||||
android:icon="@drawable/ic_action_gallery"
|
||||
android:title="@string/media"
|
||||
android:title="@string/label_media"
|
||||
android:visible="false"
|
||||
app:showAsAction="always"
|
||||
tools:ignore="AlwaysShowAction">
|
||||
|
@ -1258,4 +1258,6 @@
|
||||
<string name="users_statuses">User\'s tweets</string>
|
||||
|
||||
<string name="vibration">Vibration</string>
|
||||
<string name="message_error_buffer_media_not_supported">Schedule media with Buffer is not yet supported</string>
|
||||
<string name="title_buffer_set_schedule">Schedule with Buffer</string>
|
||||
</resources>
|
||||
|
Loading…
x
Reference in New Issue
Block a user