疑似アカウントなのにRelationshipを取得しようとしてたが無駄なのでやめた
This commit is contained in:
parent
105f60b972
commit
5b136fcaa1
|
@ -9,8 +9,8 @@ android {
|
||||||
applicationId "jp.juggler.subwaytooter"
|
applicationId "jp.juggler.subwaytooter"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 25
|
targetSdkVersion 25
|
||||||
versionCode 35
|
versionCode 36
|
||||||
versionName "0.3.5"
|
versionName "0.3.6"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,4 +62,7 @@ dependencies {
|
||||||
compile 'com.github.woxthebox:draglistview:1.4.3'
|
compile 'com.github.woxthebox:draglistview:1.4.3'
|
||||||
compile 'com.github.omadahealth:swipy:1.2.3@aar'
|
compile 'com.github.omadahealth:swipy:1.2.3@aar'
|
||||||
compile 'com.jrummyapps:colorpicker:2.1.6'
|
compile 'com.jrummyapps:colorpicker:2.1.6'
|
||||||
|
|
||||||
|
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ public class ActAppSetting extends AppCompatActivity implements CompoundButton.O
|
||||||
Spinner spBackButtonAction;
|
Spinner spBackButtonAction;
|
||||||
Spinner spUITheme;
|
Spinner spUITheme;
|
||||||
Spinner spResizeImage;
|
Spinner spResizeImage;
|
||||||
|
Spinner spRefreshAfterToot;
|
||||||
|
|
||||||
CheckBox cbNotificationSound;
|
CheckBox cbNotificationSound;
|
||||||
CheckBox cbNotificationVibration;
|
CheckBox cbNotificationVibration;
|
||||||
|
@ -122,6 +123,20 @@ public class ActAppSetting extends AppCompatActivity implements CompoundButton.O
|
||||||
spResizeImage.setAdapter( adapter );
|
spResizeImage.setAdapter( adapter );
|
||||||
spResizeImage.setOnItemSelectedListener( this );
|
spResizeImage.setOnItemSelectedListener( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
String[] caption_list = new String[]{
|
||||||
|
getString( R.string.refresh_scroll_to_toot ),
|
||||||
|
getString( R.string.refresh_no_scroll ),
|
||||||
|
getString( R.string.dont_refresh ),
|
||||||
|
};
|
||||||
|
ArrayAdapter< String > adapter = new ArrayAdapter<>( this, android.R.layout.simple_spinner_item, caption_list );
|
||||||
|
adapter.setDropDownViewResource( R.layout.lv_spinner_dropdown );
|
||||||
|
spRefreshAfterToot = (Spinner) findViewById( R.id.spRefreshAfterToot );
|
||||||
|
spRefreshAfterToot.setAdapter( adapter );
|
||||||
|
spRefreshAfterToot.setOnItemSelectedListener( this );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean load_busy;
|
boolean load_busy;
|
||||||
|
@ -143,7 +158,7 @@ public class ActAppSetting extends AppCompatActivity implements CompoundButton.O
|
||||||
spBackButtonAction.setSelection( pref.getInt( Pref.KEY_BACK_BUTTON_ACTION, 0 ) );
|
spBackButtonAction.setSelection( pref.getInt( Pref.KEY_BACK_BUTTON_ACTION, 0 ) );
|
||||||
spUITheme.setSelection( pref.getInt( Pref.KEY_UI_THEME, 0 ) );
|
spUITheme.setSelection( pref.getInt( Pref.KEY_UI_THEME, 0 ) );
|
||||||
spResizeImage.setSelection( pref.getInt( Pref.KEY_RESIZE_IMAGE, 4 ) );
|
spResizeImage.setSelection( pref.getInt( Pref.KEY_RESIZE_IMAGE, 4 ) );
|
||||||
|
spRefreshAfterToot.setSelection( pref.getInt( Pref.KEY_REFRESH_AFTER_TOOT, 0 ) );
|
||||||
load_busy = false;
|
load_busy = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +179,7 @@ public class ActAppSetting extends AppCompatActivity implements CompoundButton.O
|
||||||
.putInt( Pref.KEY_BACK_BUTTON_ACTION, spBackButtonAction.getSelectedItemPosition() )
|
.putInt( Pref.KEY_BACK_BUTTON_ACTION, spBackButtonAction.getSelectedItemPosition() )
|
||||||
.putInt( Pref.KEY_UI_THEME, spUITheme.getSelectedItemPosition() )
|
.putInt( Pref.KEY_UI_THEME, spUITheme.getSelectedItemPosition() )
|
||||||
.putInt( Pref.KEY_RESIZE_IMAGE, spResizeImage.getSelectedItemPosition() )
|
.putInt( Pref.KEY_RESIZE_IMAGE, spResizeImage.getSelectedItemPosition() )
|
||||||
|
.putInt( Pref.KEY_REFRESH_AFTER_TOOT, spRefreshAfterToot.getSelectedItemPosition() )
|
||||||
.apply();
|
.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,8 @@ import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
|
|
||||||
|
import com.astuetz.PagerSlidingTabStrip;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
@ -129,10 +131,13 @@ public class ActMain extends AppCompatActivity
|
||||||
reloadAccountSetting();
|
reloadAccountSetting();
|
||||||
|
|
||||||
if( ! TextUtils.isEmpty( posted_acct ) ){
|
if( ! TextUtils.isEmpty( posted_acct ) ){
|
||||||
for( Column column : pager_adapter.column_list ){
|
int refresh_after_toot = pref.getInt( Pref.KEY_REFRESH_AFTER_TOOT,0);
|
||||||
SavedAccount a = column.access_info;
|
if( refresh_after_toot != Pref.RAT_DONT_REFRESH ){
|
||||||
if( ! Utils.equalsNullable( a.acct,posted_acct )) continue;
|
for( Column column : pager_adapter.column_list ){
|
||||||
column.startRefreshForPost(posted_status_id);
|
SavedAccount a = column.access_info;
|
||||||
|
if( ! Utils.equalsNullable( a.acct,posted_acct )) continue;
|
||||||
|
column.startRefreshForPost(posted_status_id,refresh_after_toot);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
posted_acct = null;
|
posted_acct = null;
|
||||||
}
|
}
|
||||||
|
@ -397,7 +402,6 @@ public class ActMain extends AppCompatActivity
|
||||||
void initUI(){
|
void initUI(){
|
||||||
setContentView( R.layout.act_main );
|
setContentView( R.layout.act_main );
|
||||||
llEmpty = findViewById( R.id.llEmpty );
|
llEmpty = findViewById( R.id.llEmpty );
|
||||||
|
|
||||||
// // toolbar
|
// // toolbar
|
||||||
// Toolbar toolbar = (Toolbar) findViewById( R.id.toolbar );
|
// Toolbar toolbar = (Toolbar) findViewById( R.id.toolbar );
|
||||||
// setSupportActionBar( toolbar );
|
// setSupportActionBar( toolbar );
|
||||||
|
@ -433,6 +437,7 @@ public class ActMain extends AppCompatActivity
|
||||||
pager = (ViewPager) findViewById( R.id.viewPager );
|
pager = (ViewPager) findViewById( R.id.viewPager );
|
||||||
pager_adapter = new ColumnPagerAdapter( this );
|
pager_adapter = new ColumnPagerAdapter( this );
|
||||||
pager.setAdapter( pager_adapter );
|
pager.setAdapter( pager_adapter );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void performAccountAdd(){
|
public void performAccountAdd(){
|
||||||
|
|
|
@ -71,6 +71,8 @@ class Column {
|
||||||
private static final String PATH_MUTES = "/api/v1/mutes?limit=" + READ_LIMIT; // 1:account_id
|
private static final String PATH_MUTES = "/api/v1/mutes?limit=" + READ_LIMIT; // 1:account_id
|
||||||
private static final String PATH_BLOCKS = "/api/v1/blocks?limit=" + READ_LIMIT; // 1:account_id
|
private static final String PATH_BLOCKS = "/api/v1/blocks?limit=" + READ_LIMIT; // 1:account_id
|
||||||
private static final String PATH_FOLLOW_REQUESTS = "/api/v1/follow_requests?limit=" + READ_LIMIT; // 1:account_id
|
private static final String PATH_FOLLOW_REQUESTS = "/api/v1/follow_requests?limit=" + READ_LIMIT; // 1:account_id
|
||||||
|
private static final String PATH_BOOSTED_BY = "/api/v1/statuses/%s/reblogged_by?limit=" + READ_LIMIT; // 1:status_id
|
||||||
|
private static final String PATH_FAVOURITED_BY = "/api/v1/statuses/%s/favourited_by?limit=" + READ_LIMIT; // 1:status_id
|
||||||
|
|
||||||
// 他のリストを返すAPI
|
// 他のリストを返すAPI
|
||||||
private static final String PATH_REPORTS = "/api/v1/reports?limit=" + READ_LIMIT;
|
private static final String PATH_REPORTS = "/api/v1/reports?limit=" + READ_LIMIT;
|
||||||
|
@ -119,6 +121,8 @@ class Column {
|
||||||
static final int TYPE_MUTES = 11;
|
static final int TYPE_MUTES = 11;
|
||||||
static final int TYPE_BLOCKS = 12;
|
static final int TYPE_BLOCKS = 12;
|
||||||
static final int TYPE_FOLLOW_REQUESTS = 13;
|
static final int TYPE_FOLLOW_REQUESTS = 13;
|
||||||
|
static final int TYPE_BOOSTED_BY = 14;
|
||||||
|
static final int TYPE_FAVOURITED_BY = 15;
|
||||||
|
|
||||||
@NonNull final ActMain activity;
|
@NonNull final ActMain activity;
|
||||||
@NonNull final SavedAccount access_info;
|
@NonNull final SavedAccount access_info;
|
||||||
|
@ -155,6 +159,8 @@ class Column {
|
||||||
switch( type ){
|
switch( type ){
|
||||||
|
|
||||||
case TYPE_CONVERSATION:
|
case TYPE_CONVERSATION:
|
||||||
|
case TYPE_BOOSTED_BY:
|
||||||
|
case TYPE_FAVOURITED_BY:
|
||||||
this.status_id = (Long) getParamAt( params, 0 );
|
this.status_id = (Long) getParamAt( params, 0 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -186,6 +192,8 @@ class Column {
|
||||||
|
|
||||||
switch( column_type ){
|
switch( column_type ){
|
||||||
case TYPE_CONVERSATION:
|
case TYPE_CONVERSATION:
|
||||||
|
case TYPE_BOOSTED_BY:
|
||||||
|
case TYPE_FAVOURITED_BY:
|
||||||
item.put( KEY_STATUS_ID, status_id );
|
item.put( KEY_STATUS_ID, status_id );
|
||||||
break;
|
break;
|
||||||
case TYPE_PROFILE:
|
case TYPE_PROFILE:
|
||||||
|
@ -226,6 +234,8 @@ class Column {
|
||||||
switch( column_type ){
|
switch( column_type ){
|
||||||
|
|
||||||
case TYPE_CONVERSATION:
|
case TYPE_CONVERSATION:
|
||||||
|
case TYPE_BOOSTED_BY:
|
||||||
|
case TYPE_FAVOURITED_BY:
|
||||||
this.status_id = src.optLong( KEY_STATUS_ID );
|
this.status_id = src.optLong( KEY_STATUS_ID );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -263,6 +273,8 @@ class Column {
|
||||||
}
|
}
|
||||||
|
|
||||||
case TYPE_CONVERSATION:
|
case TYPE_CONVERSATION:
|
||||||
|
case TYPE_BOOSTED_BY:
|
||||||
|
case TYPE_FAVOURITED_BY:
|
||||||
try{
|
try{
|
||||||
long status_id = (Long) getParamAt( params, 0 );
|
long status_id = (Long) getParamAt( params, 0 );
|
||||||
return status_id == this.status_id;
|
return status_id == this.status_id;
|
||||||
|
@ -330,6 +342,12 @@ class Column {
|
||||||
case TYPE_CONVERSATION:
|
case TYPE_CONVERSATION:
|
||||||
return activity.getString( R.string.conversation_around, status_id );
|
return activity.getString( R.string.conversation_around, status_id );
|
||||||
|
|
||||||
|
case TYPE_BOOSTED_BY:
|
||||||
|
return activity.getString( R.string.boosted_by );
|
||||||
|
|
||||||
|
case TYPE_FAVOURITED_BY:
|
||||||
|
return activity.getString( R.string.favourited_by );
|
||||||
|
|
||||||
case TYPE_HASHTAG:
|
case TYPE_HASHTAG:
|
||||||
return activity.getString( R.string.hashtag_of, hashtag );
|
return activity.getString( R.string.hashtag_of, hashtag );
|
||||||
|
|
||||||
|
@ -379,6 +397,12 @@ class Column {
|
||||||
case TYPE_CONVERSATION:
|
case TYPE_CONVERSATION:
|
||||||
return R.attr.ic_conversation;
|
return R.attr.ic_conversation;
|
||||||
|
|
||||||
|
case TYPE_BOOSTED_BY:
|
||||||
|
return R.attr.btn_boost;
|
||||||
|
|
||||||
|
case TYPE_FAVOURITED_BY:
|
||||||
|
return R.attr.btn_favourite;
|
||||||
|
|
||||||
case TYPE_HASHTAG:
|
case TYPE_HASHTAG:
|
||||||
return R.attr.ic_hashtag;
|
return R.attr.ic_hashtag;
|
||||||
|
|
||||||
|
@ -975,6 +999,13 @@ class Column {
|
||||||
case TYPE_NOTIFICATIONS:
|
case TYPE_NOTIFICATIONS:
|
||||||
return parseNotifications( client, PATH_NOTIFICATIONS );
|
return parseNotifications( client, PATH_NOTIFICATIONS );
|
||||||
|
|
||||||
|
case TYPE_BOOSTED_BY:
|
||||||
|
return parseAccountList( client, String.format( Locale.JAPAN,PATH_BOOSTED_BY,status_id ) );
|
||||||
|
|
||||||
|
case TYPE_FAVOURITED_BY:
|
||||||
|
return parseAccountList( client, String.format( Locale.JAPAN,PATH_FAVOURITED_BY,status_id ) );
|
||||||
|
|
||||||
|
|
||||||
case TYPE_CONVERSATION:
|
case TYPE_CONVERSATION:
|
||||||
|
|
||||||
// 指定された発言そのもの
|
// 指定された発言そのもの
|
||||||
|
@ -1102,6 +1133,8 @@ class Column {
|
||||||
|
|
||||||
private void updateRelation( TootApiClient client, ArrayList< Object > list_tmp ){
|
private void updateRelation( TootApiClient client, ArrayList< Object > list_tmp ){
|
||||||
if( list_tmp == null || list_tmp.isEmpty() ) return;
|
if( list_tmp == null || list_tmp.isEmpty() ) return;
|
||||||
|
if( access_info.isPseudo() ) return;
|
||||||
|
|
||||||
HashSet< Long > who_set = new HashSet<>();
|
HashSet< Long > who_set = new HashSet<>();
|
||||||
HashSet< String > acct_set = new HashSet<>();
|
HashSet< String > acct_set = new HashSet<>();
|
||||||
{
|
{
|
||||||
|
@ -1212,16 +1245,16 @@ class Column {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void startRefreshForPost( long status_id ){
|
void startRefreshForPost( long status_id, int refresh_after_toot ){
|
||||||
switch(column_type){
|
switch(column_type){
|
||||||
case TYPE_HOME:
|
case TYPE_HOME:
|
||||||
case TYPE_LOCAL:
|
case TYPE_LOCAL:
|
||||||
case TYPE_FEDERATE:
|
case TYPE_FEDERATE:
|
||||||
startRefresh( true, false, status_id );
|
startRefresh( true, false, status_id ,refresh_after_toot);
|
||||||
break;
|
break;
|
||||||
case TYPE_PROFILE:
|
case TYPE_PROFILE:
|
||||||
if( profile_tab == TAB_STATUS && profile_id == access_info.id ){
|
if( profile_tab == TAB_STATUS && profile_id == access_info.id ){
|
||||||
startRefresh( true, false, status_id );
|
startRefresh( true, false, status_id ,refresh_after_toot);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TYPE_CONVERSATION:
|
case TYPE_CONVERSATION:
|
||||||
|
@ -1231,7 +1264,7 @@ class Column {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void startRefresh( boolean bSilent, final boolean bBottom ,final long status_id){
|
void startRefresh( final boolean bSilent, final boolean bBottom , final long status_id, final int refresh_after_toot){
|
||||||
|
|
||||||
if( last_task != null ){
|
if( last_task != null ){
|
||||||
if( ! bSilent ){
|
if( ! bSilent ){
|
||||||
|
@ -1608,6 +1641,14 @@ class Column {
|
||||||
case TYPE_NOTIFICATIONS:
|
case TYPE_NOTIFICATIONS:
|
||||||
return getNotificationList( client, PATH_NOTIFICATIONS );
|
return getNotificationList( client, PATH_NOTIFICATIONS );
|
||||||
|
|
||||||
|
case TYPE_BOOSTED_BY:
|
||||||
|
return getAccountList( client, String.format( Locale.JAPAN,PATH_BOOSTED_BY,status_id ) );
|
||||||
|
|
||||||
|
case TYPE_FAVOURITED_BY:
|
||||||
|
return getAccountList( client, String.format( Locale.JAPAN,PATH_FAVOURITED_BY,status_id ) );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
case TYPE_PROFILE:
|
case TYPE_PROFILE:
|
||||||
if( who_account == null ){
|
if( who_account == null ){
|
||||||
parseAccount1( client.request(
|
parseAccount1( client.request(
|
||||||
|
@ -1749,21 +1790,22 @@ class Column {
|
||||||
list_data.addAll( list_new );
|
list_data.addAll( list_new );
|
||||||
fireShowContent();
|
fireShowContent();
|
||||||
|
|
||||||
if( status_index >= 0 ){
|
if( status_index >= 0 && refresh_after_toot == Pref.RAT_REFRESH_SCROLL){
|
||||||
if( holder != null ){
|
if( holder != null ){
|
||||||
//noinspection ConstantConditions
|
//noinspection ConstantConditions
|
||||||
sp.pos = status_index;
|
sp.pos = status_index;
|
||||||
sp.top = 0;
|
sp.top = 0;
|
||||||
holder.setScrollPosition( sp, 0f );
|
holder.setScrollPosition( sp, 0f );
|
||||||
}else{
|
}else{
|
||||||
scroll_save.pos += status_index;
|
scroll_save.pos = status_index;
|
||||||
scroll_save.top = 0;
|
scroll_save.top = 0;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
float delta = bSilent ? 0f : - 20f;
|
||||||
if( holder != null ){
|
if( holder != null ){
|
||||||
//noinspection ConstantConditions
|
//noinspection ConstantConditions
|
||||||
sp.pos += added;
|
sp.pos += added;
|
||||||
holder.setScrollPosition( sp, - 20f );
|
holder.setScrollPosition( sp, delta );
|
||||||
}else{
|
}else{
|
||||||
scroll_save.pos += added;
|
scroll_save.pos += added;
|
||||||
}
|
}
|
||||||
|
@ -2037,6 +2079,13 @@ class Column {
|
||||||
return getStatusList( client,
|
return getStatusList( client,
|
||||||
String.format( Locale.JAPAN, PATH_HASHTAG, Uri.encode( hashtag ) ) );
|
String.format( Locale.JAPAN, PATH_HASHTAG, Uri.encode( hashtag ) ) );
|
||||||
|
|
||||||
|
case TYPE_BOOSTED_BY:
|
||||||
|
return getAccountList( client, String.format( Locale.JAPAN,PATH_BOOSTED_BY,status_id ) );
|
||||||
|
|
||||||
|
case TYPE_FAVOURITED_BY:
|
||||||
|
return getAccountList( client, String.format( Locale.JAPAN,PATH_FAVOURITED_BY,status_id ) );
|
||||||
|
|
||||||
|
|
||||||
case TYPE_MUTES:
|
case TYPE_MUTES:
|
||||||
return getAccountList( client, PATH_MUTES );
|
return getAccountList( client, PATH_MUTES );
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ class ColumnPagerAdapter extends PagerAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public CharSequence getPageTitle( int page_idx ){
|
@Override public CharSequence getPageTitle( int page_idx ){
|
||||||
return "page" + page_idx;
|
return getColumn( page_idx).getColumnName( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean isViewFromObject( View view, Object object ){
|
@Override public boolean isViewFromObject( View view, Object object ){
|
||||||
|
|
|
@ -272,7 +272,7 @@ class ColumnViewHolder
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void onRefresh( SwipyRefreshLayoutDirection direction ){
|
@Override public void onRefresh( SwipyRefreshLayoutDirection direction ){
|
||||||
column.startRefresh( false, direction == SwipyRefreshLayoutDirection.BOTTOM ,-1L);
|
column.startRefresh( false, direction == SwipyRefreshLayoutDirection.BOTTOM ,-1L,-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void onCheckedChanged( CompoundButton view, boolean isChecked ){
|
@Override public void onCheckedChanged( CompoundButton view, boolean isChecked ){
|
||||||
|
|
|
@ -44,7 +44,7 @@ class DlgContextMenu implements View.OnClickListener {
|
||||||
, @NonNull SavedAccount access_info
|
, @NonNull SavedAccount access_info
|
||||||
, @NonNull TootAccount who
|
, @NonNull TootAccount who
|
||||||
, @Nullable TootStatus status
|
, @Nullable TootStatus status
|
||||||
,int column_type
|
, int column_type
|
||||||
){
|
){
|
||||||
this.activity = activity;
|
this.activity = activity;
|
||||||
this.access_info = access_info;
|
this.access_info = access_info;
|
||||||
|
@ -131,12 +131,12 @@ class DlgContextMenu implements View.OnClickListener {
|
||||||
btnBlock.setOnClickListener( this );
|
btnBlock.setOnClickListener( this );
|
||||||
|
|
||||||
// 被フォロー状態
|
// 被フォロー状態
|
||||||
ImageView ivFollowedBy = (ImageView) viewRoot.findViewById( R.id. ivFollowedBy);
|
ImageView ivFollowedBy = (ImageView) viewRoot.findViewById( R.id.ivFollowedBy );
|
||||||
if( !relation.followed_by){
|
if( ! relation.followed_by ){
|
||||||
ivFollowedBy.setVisibility( View.GONE );
|
ivFollowedBy.setVisibility( View.GONE );
|
||||||
}else{
|
}else{
|
||||||
ivFollowedBy.setVisibility( View.VISIBLE );
|
ivFollowedBy.setVisibility( View.VISIBLE );
|
||||||
ivFollowedBy.setImageResource( Styler.getAttributeResourceId( activity,R.attr.ic_followed_by ));
|
ivFollowedBy.setImageResource( Styler.getAttributeResourceId( activity, R.attr.ic_followed_by ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// follow button
|
// follow button
|
||||||
|
@ -203,14 +203,21 @@ class DlgContextMenu implements View.OnClickListener {
|
||||||
|
|
||||||
v = viewRoot.findViewById( R.id.btnCancel );
|
v = viewRoot.findViewById( R.id.btnCancel );
|
||||||
v.setOnClickListener( this );
|
v.setOnClickListener( this );
|
||||||
|
|
||||||
|
v = viewRoot.findViewById( R.id.btnBoostedBy );
|
||||||
|
v.setOnClickListener( this );
|
||||||
|
|
||||||
|
v = viewRoot.findViewById( R.id.btnFavouritedBy );
|
||||||
|
v.setOnClickListener( this );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void show(){
|
void show(){
|
||||||
//noinspection ConstantConditions
|
//noinspection ConstantConditions
|
||||||
WindowManager.LayoutParams lp = dialog.getWindow().getAttributes();
|
WindowManager.LayoutParams lp = dialog.getWindow().getAttributes();
|
||||||
lp.width = (int)(0.5f + 280f * activity.density);
|
lp.width = (int) ( 0.5f + 280f * activity.density );
|
||||||
lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||||
dialog.getWindow().setAttributes(lp);
|
dialog.getWindow().setAttributes( lp );
|
||||||
|
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
@ -281,11 +288,23 @@ class DlgContextMenu implements View.OnClickListener {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case R.id.btnBoostedBy:
|
||||||
|
if( status != null ){
|
||||||
|
activity.addColumn( access_info, Column.TYPE_BOOSTED_BY, status.id );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case R.id.btnFavouritedBy:
|
||||||
|
if( status != null ){
|
||||||
|
activity.addColumn( access_info, Column.TYPE_FAVOURITED_BY, status.id );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case R.id.btnFollow:
|
case R.id.btnFollow:
|
||||||
if( relation.following || relation.requested ){
|
if( relation.following || relation.requested ){
|
||||||
activity.callFollow( access_info, who, false, false,activity.unfollow_complete_callback );
|
activity.callFollow( access_info, who, false, false, activity.unfollow_complete_callback );
|
||||||
}else{
|
}else{
|
||||||
activity.callFollow( access_info, who, true, false,activity.follow_complete_callback );
|
activity.callFollow( access_info, who, true, false, activity.follow_complete_callback );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -345,7 +364,7 @@ class DlgContextMenu implements View.OnClickListener {
|
||||||
final String who_acct = access_info.getFullAcct( who );
|
final String who_acct = access_info.getFullAcct( who );
|
||||||
AccountPicker.pick( activity, false, false, account_list_non_pseudo, new AccountPicker.AccountPickerCallback() {
|
AccountPicker.pick( activity, false, false, account_list_non_pseudo, new AccountPicker.AccountPickerCallback() {
|
||||||
@Override public void onAccountPicked( SavedAccount ai ){
|
@Override public void onAccountPicked( SavedAccount ai ){
|
||||||
activity.callRemoteFollow( ai, who_acct, who.locked, false,activity.follow_complete_callback );
|
activity.callRemoteFollow( ai, who_acct, who.locked, false, activity.follow_complete_callback );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
break;
|
break;
|
||||||
|
@ -357,15 +376,15 @@ class DlgContextMenu implements View.OnClickListener {
|
||||||
case R.id.btnOpenProfileFromAnotherAccount:
|
case R.id.btnOpenProfileFromAnotherAccount:
|
||||||
activity.performOpenUserFromAnotherAccount( who, account_list_non_pseudo_same_instance );
|
activity.performOpenUserFromAnotherAccount( who, account_list_non_pseudo_same_instance );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.btnNickname:
|
case R.id.btnNickname:
|
||||||
ActNickname.open( activity,access_info.getFullAcct( who ) ,ActMain.REQUEST_CODE_NICKNAME );
|
ActNickname.open( activity, access_info.getFullAcct( who ), ActMain.REQUEST_CODE_NICKNAME );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.btnCancel:
|
case R.id.btnCancel:
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,7 @@ class ItemViewHolder implements View.OnClickListener, View.OnLongClickListener {
|
||||||
showBoost(
|
showBoost(
|
||||||
n.account
|
n.account
|
||||||
, n.time_created_at
|
, n.time_created_at
|
||||||
, R.attr.btn_boost
|
, R.attr.ic_follow_plus
|
||||||
, Utils.formatSpannable1( activity, R.string.display_name_followed_by, n.account.display_name )
|
, Utils.formatSpannable1( activity, R.string.display_name_followed_by, n.account.display_name )
|
||||||
);
|
);
|
||||||
//
|
//
|
||||||
|
|
|
@ -13,6 +13,10 @@ class Pref {
|
||||||
|
|
||||||
private static final String KEY_BACK_TO_COLUMN_LIST = "BackToColumnList"; // 使わなくなった
|
private static final String KEY_BACK_TO_COLUMN_LIST = "BackToColumnList"; // 使わなくなった
|
||||||
|
|
||||||
|
static final int RAT_REFRESH_SCROLL = 0;
|
||||||
|
static final int RAT_REFRESH__DONT_SCROLL = 1;
|
||||||
|
static final int RAT_DONT_REFRESH = 2;
|
||||||
|
|
||||||
static final String KEY_DONT_CONFIRM_BEFORE_CLOSE_COLUMN = "DontConfirmBeforeCloseColumn";
|
static final String KEY_DONT_CONFIRM_BEFORE_CLOSE_COLUMN = "DontConfirmBeforeCloseColumn";
|
||||||
static final String KEY_BACK_BUTTON_ACTION = "back_button_action";
|
static final String KEY_BACK_BUTTON_ACTION = "back_button_action";
|
||||||
static final String KEY_PRIOR_LOCAL_URL = "prior_local_url";
|
static final String KEY_PRIOR_LOCAL_URL = "prior_local_url";
|
||||||
|
@ -25,5 +29,6 @@ class Pref {
|
||||||
static final String KEY_EXIT_APP_WHEN_CLOSE_PROTECTED_COLUMN = "ExitAppWhenCloseProtectedColumn";
|
static final String KEY_EXIT_APP_WHEN_CLOSE_PROTECTED_COLUMN = "ExitAppWhenCloseProtectedColumn";
|
||||||
static final String KEY_RESIZE_IMAGE = "resize_image";
|
static final String KEY_RESIZE_IMAGE = "resize_image";
|
||||||
static final String KEY_SHOW_FOLLOW_BUTTON_IN_BUTTON_BAR = "ShowFollowButtonInButtonBar";
|
static final String KEY_SHOW_FOLLOW_BUTTON_IN_BUTTON_BAR = "ShowFollowButtonInButtonBar";
|
||||||
|
static final String KEY_REFRESH_AFTER_TOOT = "refresh_after_toot";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,6 +208,26 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View style="@style/setting_divider"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/setting_row_label"
|
||||||
|
android:text="@string/refresh_after_toot"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<LinearLayout style="@style/setting_row_form">
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/spRefreshAfterToot"
|
||||||
|
style="@style/setting_horizontal_stretch"
|
||||||
|
android:gravity="center"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<View style="@style/setting_divider"/>
|
||||||
|
|
||||||
<!--<TextView-->
|
<!--<TextView-->
|
||||||
<!--style="@style/setting_row_label"-->
|
<!--style="@style/setting_row_label"-->
|
||||||
|
|
|
@ -74,6 +74,36 @@
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnBoostedBy"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/btn_bg_transparent"
|
||||||
|
android:gravity="start|center_vertical"
|
||||||
|
android:minHeight="32dp"
|
||||||
|
android:paddingBottom="4dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
android:text="@string/boosted_by"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnFavouritedBy"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/btn_bg_transparent"
|
||||||
|
android:gravity="start|center_vertical"
|
||||||
|
android:minHeight="32dp"
|
||||||
|
android:paddingBottom="4dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
android:text="@string/favourited_by"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btnFavouriteAnotherAccount"
|
android:id="@+id/btnFavouriteAnotherAccount"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -253,5 +253,11 @@
|
||||||
<string name="dont_confirm_again">Don\'t confirm again</string>
|
<string name="dont_confirm_again">Don\'t confirm again</string>
|
||||||
<string name="follow_request_cant_remove_by_sender">seems follow request can\'t be removed by sender…</string>
|
<string name="follow_request_cant_remove_by_sender">seems follow request can\'t be removed by sender…</string>
|
||||||
<string name="it_is_you">It\'s you.</string>
|
<string name="it_is_you">It\'s you.</string>
|
||||||
|
<string name="boosted_by">Boosted by…</string>
|
||||||
|
<string name="dont_refresh">Don\'t refresh</string>
|
||||||
|
<string name="favourited_by">Favourited by…</string>
|
||||||
|
<string name="refresh_after_toot">Refresh after toot</string>
|
||||||
|
<string name="refresh_no_scroll">Refresh, Don\'t scroll</string>
|
||||||
|
<string name="refresh_scroll_to_toot">Refresh, Scroll to toot</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -249,4 +249,10 @@
|
||||||
<string name="profile">プロフィール</string>
|
<string name="profile">プロフィール</string>
|
||||||
<string name="profile_of">%1$s のプロフィール</string>
|
<string name="profile_of">%1$s のプロフィール</string>
|
||||||
<string name="it_is_you">あなたです</string>
|
<string name="it_is_you">あなたです</string>
|
||||||
|
<string name="boosted_by">発言をブーストした人</string>
|
||||||
|
<string name="dont_refresh">更新しない</string>
|
||||||
|
<string name="favourited_by">発言をお気に入りした人</string>
|
||||||
|
<string name="refresh_after_toot">発言後の更新</string>
|
||||||
|
<string name="refresh_no_scroll">更新するがスクロールしない</string>
|
||||||
|
<string name="refresh_scroll_to_toot">更新して発言までスクロール</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -248,4 +248,10 @@
|
||||||
<string name="profile">Profile</string>
|
<string name="profile">Profile</string>
|
||||||
<string name="profile_of">Profile of %1$s</string>
|
<string name="profile_of">Profile of %1$s</string>
|
||||||
<string name="it_is_you">It\'s you.</string>
|
<string name="it_is_you">It\'s you.</string>
|
||||||
|
<string name="refresh_after_toot">Refresh after toot</string>
|
||||||
|
<string name="refresh_scroll_to_toot">Refresh, Scroll to toot</string>
|
||||||
|
<string name="refresh_no_scroll">Refresh, Don\'t scroll</string>
|
||||||
|
<string name="dont_refresh">Don\'t refresh</string>
|
||||||
|
<string name="boosted_by">Boosted by…</string>
|
||||||
|
<string name="favourited_by">Favourited by…</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in New Issue