v0.9.8
- クラッシュ対応 - 疑似アカウントTLやトゥート検索TLでトゥートのコンテキストメニューに出る別アカ操作が不足していたのを修正 - 「選択してコピー」に添付メディアのURLを追加 - アカウントに対する「選択してコピー」操作 - 入力補完用サーバリストを更新 - 「タンスのタイムラインを開く」をアカウントのコンテキストメニューに追加
This commit is contained in:
parent
99d20bd06d
commit
1297393b00
|
@ -9,8 +9,8 @@ android {
|
|||
applicationId "jp.juggler.subwaytooter"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 25
|
||||
versionCode 97
|
||||
versionName "0.9.7"
|
||||
versionCode 98
|
||||
versionName "0.9.8"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
|
|
|
@ -125,11 +125,11 @@ public class ActMain extends AppCompatActivity
|
|||
if( ! app_state.column_list.isEmpty() ){
|
||||
|
||||
// 前回最後に表示していたカラムの位置にスクロールする
|
||||
int column_pos = pref.getInt(Pref.KEY_LAST_COLUMN_POS,-1);
|
||||
int column_pos = pref.getInt( Pref.KEY_LAST_COLUMN_POS, - 1 );
|
||||
if( column_pos >= 0 && column_pos < app_state.column_list.size() ){
|
||||
scrollToColumn( column_pos ,true );
|
||||
scrollToColumn( column_pos, true );
|
||||
}
|
||||
|
||||
|
||||
// 表示位置に合わせたイベントを発行
|
||||
if( pager_adapter != null ){
|
||||
onPageSelected( pager.getCurrentItem() );
|
||||
|
@ -207,7 +207,7 @@ public class ActMain extends AppCompatActivity
|
|||
boolean bRemoved = false;
|
||||
for( int i = 0, ie = app_state.column_list.size() ; i < ie ; ++ i ){
|
||||
Column column = app_state.column_list.get( i );
|
||||
|
||||
|
||||
if( column.access_info.isNA() ){
|
||||
// 検索カラムはアカウント削除とか無関係
|
||||
}else{
|
||||
|
@ -300,7 +300,7 @@ public class ActMain extends AppCompatActivity
|
|||
}else{
|
||||
column_pos = tablet_layout_manager.findFirstVisibleItemPosition();
|
||||
}
|
||||
pref.edit().putInt(Pref.KEY_LAST_COLUMN_POS,column_pos).apply();
|
||||
pref.edit().putInt( Pref.KEY_LAST_COLUMN_POS, column_pos ).apply();
|
||||
|
||||
closeListItemPopup();
|
||||
|
||||
|
@ -382,7 +382,7 @@ public class ActMain extends AppCompatActivity
|
|||
if( ! app_state.column_list.isEmpty() ){
|
||||
int select = data.getIntExtra( ActColumnList.EXTRA_SELECTION, - 1 );
|
||||
if( 0 <= select && select < app_state.column_list.size() ){
|
||||
scrollToColumn( select ,false);
|
||||
scrollToColumn( select, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -631,8 +631,8 @@ public class ActMain extends AppCompatActivity
|
|||
startActivity( new Intent( this, ActMutedWord.class ) );
|
||||
|
||||
}else if( id == R.id.mastodon_search_portal ){
|
||||
addColumn( getDefaultInsertPosition(), SavedAccount.getNA(),Column.TYPE_SEARCH_PORTAL , "" );
|
||||
|
||||
addColumn( getDefaultInsertPosition(), SavedAccount.getNA(), Column.TYPE_SEARCH_PORTAL, "" );
|
||||
|
||||
// }else if( id == R.id.nav_translation ){
|
||||
// Intent intent = new Intent(this, TransCommuActivity.class);
|
||||
// intent.putExtra(TransCommuActivity.APPLICATION_CODE_EXTRA, "FJlDoBKitg");
|
||||
|
@ -818,7 +818,7 @@ public class ActMain extends AppCompatActivity
|
|||
viewRoot.setTag( i );
|
||||
viewRoot.setOnClickListener( new View.OnClickListener() {
|
||||
@Override public void onClick( View v ){
|
||||
scrollToColumn( (Integer) v.getTag() ,false);
|
||||
scrollToColumn( (Integer) v.getTag(), false );
|
||||
}
|
||||
} );
|
||||
viewRoot.setContentDescription( column.getColumnName( true ) );
|
||||
|
@ -884,7 +884,6 @@ public class ActMain extends AppCompatActivity
|
|||
if( first != RecyclerView.NO_POSITION && nColumnWidth > 0 ){
|
||||
View child = tablet_layout_manager.findViewByPosition( first );
|
||||
slide_ratio = Math.abs( child.getLeft() / (float) nColumnWidth );
|
||||
log.d( "slide_ratio %s", slide_ratio );
|
||||
}
|
||||
|
||||
llColumnStrip.setColumnRange( first, last, slide_ratio );
|
||||
|
@ -950,7 +949,7 @@ public class ActMain extends AppCompatActivity
|
|||
if( bPseudoAccount ){
|
||||
return api_client.checkInstance();
|
||||
}else{
|
||||
return api_client.authorize1( Pref.pref(ActMain.this).getString(Pref.KEY_CLIENT_NAME,""));
|
||||
return api_client.authorize1( Pref.pref( ActMain.this ).getString( Pref.KEY_CLIENT_NAME, "" ) );
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1382,7 +1381,7 @@ public class ActMain extends AppCompatActivity
|
|||
SavedAccount a = column.access_info;
|
||||
if( done_list.contains( a ) ) continue;
|
||||
done_list.add( a );
|
||||
if( !a.isNA() ) a.reloadSetting();
|
||||
if( ! a.isNA() ) a.reloadSetting();
|
||||
column.fireShowColumnHeader();
|
||||
}
|
||||
}
|
||||
|
@ -1394,7 +1393,7 @@ public class ActMain extends AppCompatActivity
|
|||
if( ! Utils.equalsNullable( a.acct, account.acct ) ) continue;
|
||||
if( done_list.contains( a ) ) continue;
|
||||
done_list.add( a );
|
||||
if( !a.isNA() ) a.reloadSetting();
|
||||
if( ! a.isNA() ) a.reloadSetting();
|
||||
column.fireShowColumnHeader();
|
||||
}
|
||||
}
|
||||
|
@ -1428,7 +1427,7 @@ public class ActMain extends AppCompatActivity
|
|||
|
||||
if( ! app_state.column_list.isEmpty() && page_delete > 0 && page_showing == page_delete ){
|
||||
int idx = page_delete - 1;
|
||||
scrollToColumn( idx ,false);
|
||||
scrollToColumn( idx, false );
|
||||
Column c = app_state.column_list.get( idx );
|
||||
if( ! c.bFirstInitialized ){
|
||||
c.startLoading();
|
||||
|
@ -1440,7 +1439,7 @@ public class ActMain extends AppCompatActivity
|
|||
|
||||
if( ! app_state.column_list.isEmpty() && page_delete > 0 ){
|
||||
int idx = page_delete - 1;
|
||||
scrollToColumn( idx ,false);
|
||||
scrollToColumn( idx, false );
|
||||
Column c = app_state.column_list.get( idx );
|
||||
if( ! c.bFirstInitialized ){
|
||||
c.startLoading();
|
||||
|
@ -1457,7 +1456,7 @@ public class ActMain extends AppCompatActivity
|
|||
for( Column column : app_state.column_list ){
|
||||
if( column.isSameSpec( ai, type, params ) ){
|
||||
index = app_state.column_list.indexOf( column );
|
||||
scrollToColumn( index ,false);
|
||||
scrollToColumn( index, false );
|
||||
return column;
|
||||
}
|
||||
}
|
||||
|
@ -1465,7 +1464,7 @@ public class ActMain extends AppCompatActivity
|
|||
//
|
||||
Column col = new Column( app_state, ai, this, type, params );
|
||||
index = addColumn( col, index );
|
||||
scrollToColumn( index ,false);
|
||||
scrollToColumn( index, false );
|
||||
if( ! col.bFirstInitialized ){
|
||||
col.startLoading();
|
||||
}
|
||||
|
@ -1489,7 +1488,6 @@ public class ActMain extends AppCompatActivity
|
|||
}
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
public void performMuteApp( @NonNull TootApplication application ){
|
||||
MutedApp.save( application.name );
|
||||
|
@ -1584,7 +1582,7 @@ public class ActMain extends AppCompatActivity
|
|||
try{
|
||||
log.d( "openChromeTab url=%s", url );
|
||||
|
||||
if( !noIntercept && access_info != null && access_info.isNA() ){
|
||||
if( ! noIntercept && access_info != null && access_info.isNA() ){
|
||||
// トゥート検索カラムではaccess_infoは何にも紐ついていない
|
||||
|
||||
// ハッシュタグをアプリ内で開く
|
||||
|
@ -1619,7 +1617,7 @@ public class ActMain extends AppCompatActivity
|
|||
final String host = m.group( 1 );
|
||||
final String user = Uri.decode( m.group( 2 ) );
|
||||
|
||||
openProfileByHostUser( pos,access_info,url,host,user );
|
||||
openProfileByHostUser( pos, access_info, url, host, user );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1707,7 +1705,7 @@ public class ActMain extends AppCompatActivity
|
|||
if( access_info.host.equalsIgnoreCase( status.status_host ) ){
|
||||
openStatus( pos, access_info, status.id );
|
||||
}else{
|
||||
openStatusOtherInstance( pos, access_info,status.url,status.status_host,status.id);
|
||||
openStatusOtherInstance( pos, access_info, status.url, status.status_host, status.id );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2085,7 +2083,7 @@ public class ActMain extends AppCompatActivity
|
|||
return result;
|
||||
}
|
||||
target_status = null;
|
||||
TootResults tmp = TootResults.parse( log, access_info, access_info.host,result.object );
|
||||
TootResults tmp = TootResults.parse( log, access_info, access_info.host, result.object );
|
||||
if( tmp != null ){
|
||||
if( tmp.statuses != null && ! tmp.statuses.isEmpty() ){
|
||||
target_status = tmp.statuses.get( 0 );
|
||||
|
@ -2255,7 +2253,7 @@ public class ActMain extends AppCompatActivity
|
|||
return result;
|
||||
}
|
||||
target_status = null;
|
||||
TootResults tmp = TootResults.parse( log, access_info, access_info.host,result.object );
|
||||
TootResults tmp = TootResults.parse( log, access_info, access_info.host, result.object );
|
||||
if( tmp != null ){
|
||||
if( tmp.statuses != null && ! tmp.statuses.isEmpty() ){
|
||||
target_status = tmp.statuses.get( 0 );
|
||||
|
@ -2282,11 +2280,18 @@ public class ActMain extends AppCompatActivity
|
|||
, request_builder );
|
||||
|
||||
if( result != null && result.object != null ){
|
||||
// reblog,unreblog のレスポンスは信用ならんのでステータスを再取得する
|
||||
result = client.request( "/api/v1/statuses/" + target_status.id );
|
||||
if( result != null && result.object != null ){
|
||||
new_status = TootStatus.parse( log, access_info, access_info.host,result.object );
|
||||
}
|
||||
|
||||
new_status = TootStatus.parse( log, access_info, access_info.host, result.object );
|
||||
|
||||
// reblogはreblogを表すStatusを返す
|
||||
// unreblogはreblogしたStatusを返す
|
||||
if( new_status != null && new_status.reblog != null )
|
||||
new_status = new_status.reblog;
|
||||
|
||||
// // reblog,unreblog のレスポンスは信用ならんのでステータスを再取得する
|
||||
// result = client.request( "/api/v1/statuses/" + target_status.id );
|
||||
// if( result != null && result.object != null ){
|
||||
// }
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -2354,8 +2359,8 @@ public class ActMain extends AppCompatActivity
|
|||
|
||||
public void performReplyRemote(
|
||||
final SavedAccount access_info
|
||||
,final String remote_status_url
|
||||
,final long remote_status_id
|
||||
, final String remote_status_url
|
||||
, final long remote_status_id
|
||||
){
|
||||
final ProgressDialog progress = new ProgressDialog( this );
|
||||
|
||||
|
@ -2379,7 +2384,7 @@ public class ActMain extends AppCompatActivity
|
|||
|
||||
TootApiResult result = client.request( path );
|
||||
if( result != null && result.object != null ){
|
||||
TootResults tmp = TootResults.parse( log, access_info, access_info.host,result.object );
|
||||
TootResults tmp = TootResults.parse( log, access_info, access_info.host, result.object );
|
||||
if( tmp != null && tmp.statuses != null && ! tmp.statuses.isEmpty() ){
|
||||
target_status = tmp.statuses.get( 0 );
|
||||
log.d( "status id conversion %s => %s", remote_status_id, target_status.id );
|
||||
|
@ -2411,7 +2416,7 @@ public class ActMain extends AppCompatActivity
|
|||
|
||||
progress.setIndeterminate( true );
|
||||
progress.setCancelable( true );
|
||||
progress.setMessage( getString(R.string.progress_synchronize_toot) );
|
||||
progress.setMessage( getString( R.string.progress_synchronize_toot ) );
|
||||
progress.setOnCancelListener( new DialogInterface.OnCancelListener() {
|
||||
@Override public void onCancel( DialogInterface dialog ){
|
||||
task.cancel( true );
|
||||
|
@ -3376,38 +3381,37 @@ public class ActMain extends AppCompatActivity
|
|||
} );
|
||||
}
|
||||
|
||||
|
||||
void openReplyFromAnotherAccount( final TootStatusLike status){
|
||||
void openReplyFromAnotherAccount( final TootStatusLike status ){
|
||||
AccountPicker.pick( this, false, false
|
||||
, getString( R.string.account_picker_reply )
|
||||
, makeAccountListNonPseudo( log ), new AccountPicker.AccountPickerCallback() {
|
||||
@Override public void onAccountPicked( @NonNull SavedAccount ai ){
|
||||
if( (status instanceof TootStatus) && ai.host.equalsIgnoreCase( status.status_host ) ){
|
||||
performReply( ai, (TootStatus)status );
|
||||
if( ( status instanceof TootStatus ) && ai.host.equalsIgnoreCase( status.status_host ) ){
|
||||
performReply( ai, (TootStatus) status );
|
||||
}else{
|
||||
performReplyRemote( ai,status.url,status.id );
|
||||
performReplyRemote( ai, status.url, status.id );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
// void openReplyFromAnotherAccount( @NonNull final SavedAccount access_info, final String status_url,final long status_id ){
|
||||
//
|
||||
// final String status_host = getHostFromStatusUrl(status_url);
|
||||
// if( status_host ==null ) return;
|
||||
//
|
||||
// AccountPicker.pick( this, false, false
|
||||
// , getString( R.string.account_picker_reply )
|
||||
// , makeAccountListNonPseudo( log ), new AccountPicker.AccountPickerCallback() {
|
||||
// @Override public void onAccountPicked( @NonNull SavedAccount ai ){
|
||||
// performReplyRemote( ai,status_url,status_id );
|
||||
// }
|
||||
// } );
|
||||
// }
|
||||
// void openFollowFromAnotherAccount( @NonNull SavedAccount access_info, TootStatus status ){
|
||||
// if( status == null ) return;
|
||||
// openFollowFromAnotherAccount( access_info, status.account );
|
||||
// }
|
||||
// void openReplyFromAnotherAccount( @NonNull final SavedAccount access_info, final String status_url,final long status_id ){
|
||||
//
|
||||
// final String status_host = getHostFromStatusUrl(status_url);
|
||||
// if( status_host ==null ) return;
|
||||
//
|
||||
// AccountPicker.pick( this, false, false
|
||||
// , getString( R.string.account_picker_reply )
|
||||
// , makeAccountListNonPseudo( log ), new AccountPicker.AccountPickerCallback() {
|
||||
// @Override public void onAccountPicked( @NonNull SavedAccount ai ){
|
||||
// performReplyRemote( ai,status_url,status_id );
|
||||
// }
|
||||
// } );
|
||||
// }
|
||||
// void openFollowFromAnotherAccount( @NonNull SavedAccount access_info, TootStatus status ){
|
||||
// if( status == null ) return;
|
||||
// openFollowFromAnotherAccount( access_info, status.account );
|
||||
// }
|
||||
|
||||
void openFollowFromAnotherAccount( @NonNull SavedAccount access_info, final TootAccount account ){
|
||||
if( account == null ) return;
|
||||
|
@ -3588,17 +3592,16 @@ public class ActMain extends AppCompatActivity
|
|||
tablet_pager_adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private void scrollToColumn( int index ,boolean bAlign){
|
||||
private void scrollToColumn( int index, boolean bAlign ){
|
||||
scrollColumnStrip( index );
|
||||
|
||||
if( pager_adapter != null ){
|
||||
pager.setCurrentItem( index, true );
|
||||
}else if(!bAlign){
|
||||
}else if( ! bAlign ){
|
||||
// 指定したカラムが画面内に表示されるように動いてくれるようだ
|
||||
tablet_pager.smoothScrollToPosition( index );
|
||||
}else{
|
||||
// 指定位置が表示範囲の左端にくるようにスクロール
|
||||
// TODO 挙動確認
|
||||
tablet_pager.scrollToPosition( index );
|
||||
}
|
||||
}
|
||||
|
@ -3751,4 +3754,26 @@ public class ActMain extends AppCompatActivity
|
|||
task.executeOnExecutor( App1.task_executor );
|
||||
}
|
||||
|
||||
public void openTimelineFor( @NonNull String host ){
|
||||
final ArrayList< SavedAccount > account_list = new ArrayList<>( );
|
||||
for( SavedAccount a : SavedAccount.loadAccountList( log ) ){
|
||||
if( host.equalsIgnoreCase( a.host ) ) account_list.add( a );
|
||||
}
|
||||
if( account_list.isEmpty() ){
|
||||
|
||||
SavedAccount ai = addPseudoAccount( host );
|
||||
if( ai != null ){
|
||||
addColumn( getDefaultInsertPosition(), ai, Column.TYPE_LOCAL );
|
||||
}
|
||||
|
||||
}else{
|
||||
AccountPicker.pick( this, false, false
|
||||
, getString( R.string.account_picker_add_timeline_of ,host )
|
||||
, account_list, new AccountPicker.AccountPickerCallback() {
|
||||
@Override public void onAccountPicked( @NonNull SavedAccount ai ){
|
||||
addColumn( getDefaultInsertPosition(), ai, Column.TYPE_LOCAL );
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,14 +6,20 @@ import android.content.ClipboardManager;
|
|||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import jp.juggler.subwaytooter.api.entity.TootAccount;
|
||||
import jp.juggler.subwaytooter.api.entity.TootAttachment;
|
||||
import jp.juggler.subwaytooter.api.entity.TootStatus;
|
||||
import jp.juggler.subwaytooter.api.entity.TootStatusLike;
|
||||
import jp.juggler.subwaytooter.api_msp.entity.MSPAccount;
|
||||
import jp.juggler.subwaytooter.api_msp.entity.MSPToot;
|
||||
import jp.juggler.subwaytooter.table.MutedWord;
|
||||
import jp.juggler.subwaytooter.table.SavedAccount;
|
||||
|
@ -26,59 +32,138 @@ public class ActText extends AppCompatActivity implements View.OnClickListener {
|
|||
static final LogCategory log = new LogCategory( "ActText" );
|
||||
static final String EXTRA_TEXT = "text";
|
||||
static final String EXTRA_CONTENT_START = "content_start";
|
||||
static final String EXTRA_CONTENT_END = "content_end";
|
||||
|
||||
static void encodeStatus( Intent intent, Context context, SavedAccount access_info, TootStatusLike status ){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append( context.getString( R.string.send_header_url ) );
|
||||
sb.append( ": " );
|
||||
sb.append( status.url );
|
||||
sb.append( "\n" );
|
||||
sb.append( context.getString( R.string.send_header_date ) );
|
||||
sb.append( ": " );
|
||||
|
||||
if( status instanceof TootStatus ){
|
||||
TootStatus ts = (TootStatus)status;
|
||||
sb.append( TootStatus.formatTime( ts.time_created_at ) );
|
||||
}else if( status instanceof MSPToot ){
|
||||
MSPToot ts = (MSPToot)status;
|
||||
sb.append( ts.created_at );
|
||||
static void addAfterLine(StringBuilder sb,@NonNull String text){
|
||||
if(sb.length() > 0 && sb.charAt( sb.length()-1 ) != '\n' ){
|
||||
sb.append('\n');
|
||||
}
|
||||
|
||||
sb.append( "\n" );
|
||||
sb.append( context.getString( R.string.send_header_from_acct ) );
|
||||
sb.append( text );
|
||||
}
|
||||
static void addHeader(Context context,StringBuilder sb,int key_str_id,Object value){
|
||||
if(sb.length() > 0 && sb.charAt( sb.length()-1 ) != '\n' ){
|
||||
sb.append('\n');
|
||||
}
|
||||
addAfterLine( sb,context.getString( key_str_id ) );
|
||||
sb.append( ": " );
|
||||
sb.append( access_info.getFullAcct( status.account ) );
|
||||
sb.append( "\n" );
|
||||
if( status.account != null ){
|
||||
sb.append( context.getString( R.string.send_header_from_name ) );
|
||||
sb.append( ": " );
|
||||
sb.append( status.account.display_name );
|
||||
sb.append( "\n" );
|
||||
}
|
||||
if( ! TextUtils.isEmpty( status.spoiler_text ) ){
|
||||
sb.append( context.getString( R.string.send_header_content_warning ) );
|
||||
sb.append( ": " );
|
||||
sb.append( HTMLDecoder.decodeHTML( access_info, status.spoiler_text ,false,null) );
|
||||
sb.append( "\n" );
|
||||
}
|
||||
sb.append( "\n" );
|
||||
|
||||
intent.putExtra( EXTRA_CONTENT_START, sb.length() );
|
||||
|
||||
sb.append( HTMLDecoder.decodeHTML( access_info, status.content ,false,null) );
|
||||
|
||||
intent.putExtra( EXTRA_TEXT, sb.toString() );
|
||||
|
||||
|
||||
sb.append( value == null ? "(null)" : value.toString() );
|
||||
}
|
||||
|
||||
|
||||
static void encodeStatus( Intent intent, Context context, SavedAccount access_info, @NonNull TootStatusLike status ){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
addHeader( context,sb, R.string.send_header_url, status.url );
|
||||
|
||||
if( status instanceof TootStatus ){
|
||||
TootStatus ts = (TootStatus)status;
|
||||
addHeader( context,sb, R.string.send_header_date,TootStatus.formatTime( ts.time_created_at ) );
|
||||
}else if( status instanceof MSPToot ){
|
||||
MSPToot ts = (MSPToot)status;
|
||||
addHeader( context,sb, R.string.send_header_date, ts.created_at );
|
||||
}
|
||||
|
||||
if( status.account != null ){
|
||||
addHeader( context,sb, R.string.send_header_from_acct, access_info.getFullAcct( status.account ) );
|
||||
|
||||
public static void open( ActMain activity, SavedAccount access_info, TootStatusLike status ){
|
||||
addHeader( context,sb, R.string.send_header_from_name, status.account.display_name );
|
||||
}
|
||||
|
||||
if( ! TextUtils.isEmpty( status.spoiler_text ) ){
|
||||
addHeader( context,sb, R.string.send_header_content_warning
|
||||
,HTMLDecoder.decodeHTML( access_info, status.spoiler_text ,false,null) );
|
||||
}
|
||||
|
||||
addAfterLine( sb,"\n");
|
||||
|
||||
intent.putExtra( EXTRA_CONTENT_START, sb.length() );
|
||||
sb.append( HTMLDecoder.decodeHTML( access_info, status.content ,false,null) );
|
||||
intent.putExtra( EXTRA_CONTENT_END, sb.length() );
|
||||
|
||||
if( status instanceof TootStatus ){
|
||||
TootStatus ts = (TootStatus) status;
|
||||
if( ts.media_attachments != null ){
|
||||
int i = 0;
|
||||
for( TootAttachment ma : ts.media_attachments ){
|
||||
++ i;
|
||||
addAfterLine( sb,"\n");
|
||||
addAfterLine( sb, String.format( Locale.JAPAN, "Media-%d-Url: %s", i, ma.url ) );
|
||||
addAfterLine( sb, String.format( Locale.JAPAN,"Media-%d-Remote-Url: %s", i, ma.remote_url ) );
|
||||
addAfterLine( sb, String.format( Locale.JAPAN,"Media-%d-Preview-Url: %s", i, ma.preview_url ) );
|
||||
addAfterLine( sb, String.format( Locale.JAPAN,"Media-%d-Text-Url: %s", i, ma.text_url ) );
|
||||
}
|
||||
}
|
||||
}else if( status instanceof MSPToot){
|
||||
MSPToot ts = (MSPToot) status;
|
||||
if( ts.media_attachments != null ){
|
||||
int i = 0;
|
||||
for( String ma : ts.media_attachments ){
|
||||
++ i;
|
||||
addAfterLine( sb,"\n");
|
||||
addAfterLine( sb, String.format( Locale.JAPAN, "Media-%d-Preview-Url: %s", i, ma ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addAfterLine( sb,"");
|
||||
intent.putExtra( EXTRA_TEXT, sb.toString() );
|
||||
}
|
||||
|
||||
static void encodeAccount( Intent intent, Context context, SavedAccount access_info, @NonNull TootAccount who ){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
intent.putExtra( EXTRA_CONTENT_START, sb.length() );
|
||||
sb.append(who.display_name);
|
||||
sb.append("\n");
|
||||
sb.append("@");sb.append( access_info.getFullAcct( who ) );
|
||||
sb.append("\n");
|
||||
|
||||
intent.putExtra( EXTRA_CONTENT_START, sb.length() );
|
||||
sb.append( who.url );
|
||||
intent.putExtra( EXTRA_CONTENT_END, sb.length() );
|
||||
|
||||
addAfterLine( sb,"\n");
|
||||
|
||||
sb.append( HTMLDecoder.decodeHTML( access_info,(who.note!=null? who.note :null) ,false,null));
|
||||
|
||||
addAfterLine( sb,"\n");
|
||||
|
||||
addHeader( context,sb, R.string.send_header_account_name,who.display_name );
|
||||
addHeader( context,sb, R.string.send_header_account_acct, access_info.getFullAcct( who ) );
|
||||
addHeader( context,sb, R.string.send_header_account_url,who.url );
|
||||
|
||||
addHeader( context,sb, R.string.send_header_account_image_avatar, who.avatar );
|
||||
addHeader( context,sb, R.string.send_header_account_image_avatar_static, who.avatar_static );
|
||||
addHeader( context,sb, R.string.send_header_account_image_header, who.header );
|
||||
addHeader( context,sb, R.string.send_header_account_image_header_static, who.header_static );
|
||||
|
||||
if( who instanceof MSPAccount){
|
||||
// 検索結果の場合、以下のパラメータは出力しない
|
||||
}else{
|
||||
addHeader( context,sb, R.string.send_header_account_created_at, who.created_at );
|
||||
addHeader( context,sb, R.string.send_header_account_statuses_count, who.statuses_count );
|
||||
addHeader( context,sb, R.string.send_header_account_followers_count, who.followers_count );
|
||||
addHeader( context,sb, R.string.send_header_account_following_count, who.following_count );
|
||||
addHeader( context,sb, R.string.send_header_account_locked, who.locked );
|
||||
}
|
||||
|
||||
addAfterLine( sb,"");
|
||||
intent.putExtra( EXTRA_TEXT, sb.toString() );
|
||||
}
|
||||
|
||||
|
||||
public static void open( ActMain activity, SavedAccount access_info, @NonNull TootStatusLike status ){
|
||||
Intent intent = new Intent( activity, ActText.class );
|
||||
encodeStatus( intent,activity, access_info, status );
|
||||
|
||||
activity.startActivity( intent );
|
||||
}
|
||||
public static void open( ActMain activity, SavedAccount access_info, @NonNull TootAccount who ){
|
||||
Intent intent = new Intent( activity, ActText.class );
|
||||
encodeAccount( intent,activity, access_info, who );
|
||||
|
||||
activity.startActivity( intent );
|
||||
}
|
||||
|
||||
@Override protected void onCreate( @Nullable Bundle savedInstanceState ){
|
||||
super.onCreate( savedInstanceState );
|
||||
|
@ -90,8 +175,9 @@ public class ActText extends AppCompatActivity implements View.OnClickListener {
|
|||
Intent intent = getIntent();
|
||||
String sv = intent.getStringExtra( EXTRA_TEXT );
|
||||
int content_start = intent.getIntExtra( EXTRA_CONTENT_START, 0);
|
||||
int content_end = intent.getIntExtra( EXTRA_CONTENT_END, sv.length());
|
||||
etText.setText(sv);
|
||||
etText.setSelection( content_start,sv.length() );
|
||||
etText.setSelection( content_start,content_end );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -315,10 +315,6 @@ public class AlarmService extends IntentService {
|
|||
}
|
||||
}
|
||||
|
||||
private void testLog( String s ){
|
||||
// TODO アプリ設定画面に進捗表示を追加する
|
||||
}
|
||||
|
||||
String getInstallId(){
|
||||
SharedPreferences prefDevice = PrefDevice.prefDevice( this );
|
||||
|
||||
|
|
|
@ -372,7 +372,6 @@ class ColumnViewHolder
|
|||
|
||||
private void showSearchDesc( String html ){
|
||||
if( column==null) return;
|
||||
log.d("showSearchDesc: html=%s",html);
|
||||
tvSearchDesc.setVisibility( View.VISIBLE );
|
||||
tvSearchDesc.setMovementMethod( MyLinkMovementMethod.getInstance() );
|
||||
CharSequence sv = HTMLDecoder.decodeHTML( column.access_info, html, false, null );
|
||||
|
|
|
@ -37,7 +37,6 @@ class DlgContextMenu implements View.OnClickListener, View.OnLongClickListener {
|
|||
|
||||
private final Dialog dialog;
|
||||
|
||||
private final ArrayList< SavedAccount > account_list_non_pseudo_same_instance = new ArrayList<>();
|
||||
private final ArrayList< SavedAccount > account_list_non_pseudo = new ArrayList<>();
|
||||
|
||||
DlgContextMenu(
|
||||
|
@ -84,15 +83,40 @@ class DlgContextMenu implements View.OnClickListener, View.OnLongClickListener {
|
|||
View btnSendMessageFromAnotherAccount = viewRoot.findViewById( R.id.btnSendMessageFromAnotherAccount );
|
||||
View btnOpenProfileFromAnotherAccount = viewRoot.findViewById( R.id.btnOpenProfileFromAnotherAccount );
|
||||
Button btnDomainBlock = (Button) viewRoot.findViewById( R.id.btnDomainBlock );
|
||||
ImageView ivFollowedBy = (ImageView) viewRoot.findViewById( R.id.ivFollowedBy );
|
||||
Button btnOpenTimeline = (Button) viewRoot.findViewById( R.id.btnOpenTimeline );
|
||||
|
||||
ArrayList< SavedAccount > account_list = SavedAccount.loadAccountList( log );
|
||||
btnStatusWebPage.setOnClickListener( this );
|
||||
btnText.setOnClickListener( this );
|
||||
btnFavouriteAnotherAccount.setOnClickListener( this );
|
||||
btnBoostAnotherAccount.setOnClickListener( this );
|
||||
btnReplyAnotherAccount.setOnClickListener( this );
|
||||
btnReport.setOnClickListener( this );
|
||||
btnMuteApp.setOnClickListener( this );
|
||||
btnDelete.setOnClickListener( this );
|
||||
btnFollow.setOnClickListener( this );
|
||||
btnMute.setOnClickListener( this );
|
||||
btnBlock.setOnClickListener( this );
|
||||
btnFollow.setOnLongClickListener( this );
|
||||
btnProfile.setOnClickListener( this );
|
||||
btnSendMessage.setOnClickListener( this );
|
||||
btnAccountWebPage.setOnClickListener( this );
|
||||
btnFollowRequestOK.setOnClickListener( this );
|
||||
btnFollowRequestNG.setOnClickListener( this );
|
||||
btnFollowFromAnotherAccount.setOnClickListener( this );
|
||||
btnSendMessageFromAnotherAccount.setOnClickListener( this );
|
||||
btnOpenProfileFromAnotherAccount.setOnClickListener( this );
|
||||
btnOpenTimeline.setOnClickListener( this );
|
||||
|
||||
final ArrayList< SavedAccount > account_list = SavedAccount.loadAccountList( log );
|
||||
// final ArrayList< SavedAccount > account_list_non_pseudo_same_instance = new ArrayList<>();
|
||||
|
||||
for( SavedAccount a : account_list ){
|
||||
if( ! a.isPseudo() ){
|
||||
account_list_non_pseudo.add( a );
|
||||
if( a.host.equalsIgnoreCase( access_info.host ) ){
|
||||
account_list_non_pseudo_same_instance.add( a );
|
||||
}
|
||||
// if( a.host.equalsIgnoreCase( access_info.host ) ){
|
||||
// account_list_non_pseudo_same_instance.add( a );
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,49 +125,42 @@ class DlgContextMenu implements View.OnClickListener, View.OnLongClickListener {
|
|||
}else{
|
||||
boolean status_by_me = access_info.isMe( status.account );
|
||||
|
||||
btnStatusWebPage.setOnClickListener( this );
|
||||
btnText.setOnClickListener( this );
|
||||
btnDelete.setVisibility( status_by_me ? View.VISIBLE : View.GONE );
|
||||
|
||||
if( account_list_non_pseudo_same_instance.isEmpty() ){
|
||||
btnFavouriteAnotherAccount.setVisibility( View.GONE );
|
||||
btnBoostAnotherAccount.setVisibility( View.GONE );
|
||||
btnReplyAnotherAccount.setVisibility( View.GONE );
|
||||
}else{
|
||||
btnFavouriteAnotherAccount.setOnClickListener( this );
|
||||
btnBoostAnotherAccount.setOnClickListener( this );
|
||||
btnReplyAnotherAccount.setOnClickListener( this );
|
||||
}
|
||||
if( access_info.isPseudo() ){
|
||||
btnDelete.setVisibility( View.GONE );
|
||||
btnReport.setVisibility( View.GONE );
|
||||
btnMuteApp.setVisibility( View.GONE );
|
||||
}else if( status_by_me ){
|
||||
btnDelete.setOnClickListener( this );
|
||||
if( access_info.isPseudo() || status_by_me ){
|
||||
btnReport.setVisibility( View.GONE );
|
||||
btnMuteApp.setVisibility( View.GONE );
|
||||
}else{
|
||||
btnDelete.setVisibility( View.GONE );
|
||||
btnReport.setOnClickListener( this );
|
||||
if( status.application != null && !TextUtils.isEmpty( status.application.name ) ){
|
||||
if( status.application != null && ! TextUtils.isEmpty( status.application.name ) ){
|
||||
btnMuteApp.setText( activity.getString( R.string.mute_app_of, status.application.name ) );
|
||||
btnMuteApp.setOnClickListener( this );
|
||||
}else{
|
||||
btnMuteApp.setVisibility( View.GONE );
|
||||
}
|
||||
}
|
||||
|
||||
View v;
|
||||
if( access_info.isNA() ){
|
||||
v = viewRoot.findViewById( R.id.btnBoostedBy );
|
||||
v.setVisibility( View.GONE );
|
||||
|
||||
v = viewRoot.findViewById( R.id.btnFavouritedBy );
|
||||
v.setVisibility( View.GONE );
|
||||
}else{
|
||||
v = viewRoot.findViewById( R.id.btnBoostedBy );
|
||||
v.setOnClickListener( this );
|
||||
v = viewRoot.findViewById( R.id.btnFavouritedBy );
|
||||
v.setOnClickListener( this );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( access_info.isPseudo() ){
|
||||
llAccountActionBar.setVisibility( View.GONE );
|
||||
}else{
|
||||
btnFollow.setOnClickListener( this );
|
||||
btnMute.setOnClickListener( this );
|
||||
btnBlock.setOnClickListener( this );
|
||||
|
||||
btnFollow.setOnLongClickListener( this );
|
||||
|
||||
// 被フォロー状態
|
||||
ImageView ivFollowedBy = (ImageView) viewRoot.findViewById( R.id.ivFollowedBy );
|
||||
if( ! relation.followed_by ){
|
||||
ivFollowedBy.setVisibility( View.GONE );
|
||||
}else{
|
||||
|
@ -192,20 +209,14 @@ class DlgContextMenu implements View.OnClickListener, View.OnLongClickListener {
|
|||
}
|
||||
}
|
||||
|
||||
viewRoot.findViewById( R.id.btnAccountText ).setOnClickListener( this );
|
||||
|
||||
if( access_info.isPseudo() ){
|
||||
btnProfile.setVisibility( View.GONE );
|
||||
btnSendMessage.setVisibility( View.GONE );
|
||||
}else{
|
||||
btnProfile.setOnClickListener( this );
|
||||
btnSendMessage.setOnClickListener( this );
|
||||
}
|
||||
|
||||
btnAccountWebPage.setOnClickListener( this );
|
||||
|
||||
if( column_type == Column.TYPE_FOLLOW_REQUESTS ){
|
||||
btnFollowRequestOK.setOnClickListener( this );
|
||||
btnFollowRequestNG.setOnClickListener( this );
|
||||
}else{
|
||||
if( column_type != Column.TYPE_FOLLOW_REQUESTS ){
|
||||
btnFollowRequestOK.setVisibility( View.GONE );
|
||||
btnFollowRequestNG.setVisibility( View.GONE );
|
||||
}
|
||||
|
@ -213,37 +224,19 @@ class DlgContextMenu implements View.OnClickListener, View.OnLongClickListener {
|
|||
if( account_list_non_pseudo.isEmpty() ){
|
||||
btnFollowFromAnotherAccount.setVisibility( View.GONE );
|
||||
btnSendMessageFromAnotherAccount.setVisibility( View.GONE );
|
||||
}else{
|
||||
btnFollowFromAnotherAccount.setOnClickListener( this );
|
||||
btnSendMessageFromAnotherAccount.setOnClickListener( this );
|
||||
}
|
||||
|
||||
btnOpenProfileFromAnotherAccount.setOnClickListener( this );
|
||||
viewRoot.findViewById( R.id.btnNickname ).setOnClickListener( this );
|
||||
viewRoot.findViewById( R.id.btnCancel ).setOnClickListener( this );
|
||||
viewRoot.findViewById( R.id.btnAccountQrCode ).setOnClickListener( this );
|
||||
|
||||
View v = viewRoot.findViewById( R.id.btnNickname );
|
||||
v.setOnClickListener( this );
|
||||
|
||||
v = viewRoot.findViewById( R.id.btnCancel );
|
||||
v.setOnClickListener( this );
|
||||
|
||||
if( access_info.isNA() ){
|
||||
v = viewRoot.findViewById( R.id.btnBoostedBy );
|
||||
v.setVisibility( View.GONE);
|
||||
|
||||
v = viewRoot.findViewById( R.id.btnFavouritedBy );
|
||||
v.setVisibility( View.GONE);
|
||||
String host = access_info.getAccountHost( who );
|
||||
if( TextUtils.isEmpty( host) || host.equals( "?" ) ){
|
||||
btnOpenTimeline.setVisibility( View.GONE );
|
||||
}else{
|
||||
v = viewRoot.findViewById( R.id.btnBoostedBy );
|
||||
v.setOnClickListener( this );
|
||||
|
||||
v = viewRoot.findViewById( R.id.btnFavouritedBy );
|
||||
v.setOnClickListener( this );
|
||||
|
||||
btnOpenTimeline.setText( activity.getString( R.string.open_local_timeline_for, host ) );
|
||||
}
|
||||
|
||||
v = viewRoot.findViewById( R.id.btnAccountQrCode );
|
||||
v.setOnClickListener( this );
|
||||
|
||||
}
|
||||
|
||||
void show(){
|
||||
|
@ -304,7 +297,7 @@ class DlgContextMenu implements View.OnClickListener, View.OnLongClickListener {
|
|||
|
||||
case R.id.btnReport:
|
||||
if( who != null && status instanceof TootStatus ){
|
||||
activity.openReportForm( access_info, who, (TootStatus)status );
|
||||
activity.openReportForm( access_info, who, (TootStatus) status );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -338,6 +331,13 @@ class DlgContextMenu implements View.OnClickListener, View.OnLongClickListener {
|
|||
}
|
||||
break;
|
||||
|
||||
case R.id.btnAccountText:
|
||||
if( who != null ){
|
||||
ActText.open( activity, access_info, who );
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case R.id.btnMute:
|
||||
if( who == null ){
|
||||
// サーバのバグで誰のことか分からないので何もできない
|
||||
|
@ -375,11 +375,15 @@ class DlgContextMenu implements View.OnClickListener, View.OnLongClickListener {
|
|||
break;
|
||||
|
||||
case R.id.btnProfile:
|
||||
activity.openProfile( pos, access_info, who );
|
||||
if( who != null ){
|
||||
activity.openProfile( pos, access_info, who );
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.btnSendMessage:
|
||||
activity.performMention( access_info, who );
|
||||
if( who != null ){
|
||||
activity.performMention( access_info, who );
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.btnAccountWebPage:
|
||||
|
@ -458,6 +462,15 @@ class DlgContextMenu implements View.OnClickListener, View.OnLongClickListener {
|
|||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.btnOpenTimeline:
|
||||
String host = access_info.getAccountHost( who );
|
||||
if( TextUtils.isEmpty( host) || host.equals( "?" ) ){
|
||||
// 何もしない
|
||||
}else{
|
||||
activity.openTimelineFor( host );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ class HeaderViewHolder implements View.OnClickListener, View.OnLongClickListener
|
|||
}
|
||||
tvAcct.setText( Emojione.decodeEmoji( s ) );
|
||||
|
||||
tvNote.setText( who.note );
|
||||
tvNote.setText( who.decoded_note );
|
||||
btnStatusCount.setText( activity.getString( R.string.statuses ) + "\n" + who.statuses_count );
|
||||
btnFollowing.setText( activity.getString( R.string.following ) + "\n" + who.following_count );
|
||||
btnFollowers.setText( activity.getString( R.string.followers ) + "\n" + who.followers_count );
|
||||
|
|
|
@ -31,7 +31,7 @@ class StatusButtons implements View.OnClickListener, View.OnLongClickListener {
|
|||
|
||||
private final boolean bSimpleList;
|
||||
|
||||
StatusButtons( @NonNull ActMain activity, @NonNull Column column, @NonNull View viewRoot ,boolean bSimpleList){
|
||||
StatusButtons( @NonNull ActMain activity, @NonNull Column column, @NonNull View viewRoot, boolean bSimpleList ){
|
||||
this.activity = activity;
|
||||
this.column = column;
|
||||
this.access_info = column.access_info;
|
||||
|
@ -76,10 +76,10 @@ class StatusButtons implements View.OnClickListener, View.OnLongClickListener {
|
|||
|
||||
if( status instanceof MSPToot ){
|
||||
setButton( btnBoost, true, color_normal, R.attr.btn_boost, "" );
|
||||
setButton( btnFavourite, true, color_normal, R.attr.btn_favourite, "");
|
||||
setButton( btnFavourite, true, color_normal, R.attr.btn_favourite, "" );
|
||||
}else if( status instanceof TootStatus ){
|
||||
TootStatus ts = (TootStatus)status;
|
||||
|
||||
TootStatus ts = (TootStatus) status;
|
||||
|
||||
if( TootStatus.VISIBILITY_DIRECT.equals( ts.visibility ) ){
|
||||
setButton( btnBoost, false, color_accent, R.attr.ic_mail, "" );
|
||||
}else if( TootStatus.VISIBILITY_PRIVATE.equals( ts.visibility ) ){
|
||||
|
@ -99,8 +99,10 @@ class StatusButtons implements View.OnClickListener, View.OnLongClickListener {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if( status.account == null || ! activity.pref.getBoolean( Pref.KEY_SHOW_FOLLOW_BUTTON_IN_BUTTON_BAR, false ) ){
|
||||
if( status.account == null
|
||||
|| activity.pref == null
|
||||
|| ! activity.pref.getBoolean( Pref.KEY_SHOW_FOLLOW_BUTTON_IN_BUTTON_BAR, false )
|
||||
){
|
||||
llFollow2.setVisibility( View.GONE );
|
||||
this.relation = null;
|
||||
}else{
|
||||
|
@ -111,7 +113,6 @@ class StatusButtons implements View.OnClickListener, View.OnLongClickListener {
|
|||
|
||||
}
|
||||
|
||||
|
||||
private void setButton( Button b, boolean enabled, int color, int icon_attr, String text ){
|
||||
Drawable d = Styler.getAttributeDrawable( activity, icon_attr ).mutate();
|
||||
d.setColorFilter( color, PorterDuff.Mode.SRC_ATOP );
|
||||
|
@ -130,13 +131,13 @@ class StatusButtons implements View.OnClickListener, View.OnLongClickListener {
|
|||
activity.openStatus( activity.nextPosition( column ), access_info, status );
|
||||
break;
|
||||
case R.id.btnReply:
|
||||
if( status instanceof TootStatus && !access_info.isPseudo() ){
|
||||
activity.performReply( access_info, (TootStatus)status );
|
||||
if( status instanceof TootStatus && ! access_info.isPseudo() ){
|
||||
activity.performReply( access_info, (TootStatus) status );
|
||||
}else{
|
||||
activity.openReplyFromAnotherAccount( status );
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case R.id.btnBoost:
|
||||
if( access_info.isPseudo() ){
|
||||
activity.openBoostFromAnotherAccount( access_info, status );
|
||||
|
@ -144,7 +145,7 @@ class StatusButtons implements View.OnClickListener, View.OnLongClickListener {
|
|||
activity.performBoost(
|
||||
access_info
|
||||
, status
|
||||
,ActMain.NOT_CROSS_ACCOUNT
|
||||
, ActMain.NOT_CROSS_ACCOUNT
|
||||
, ! status.reblogged
|
||||
, false
|
||||
, bSimpleList ? activity.boost_complete_callback : null
|
||||
|
@ -159,7 +160,7 @@ class StatusButtons implements View.OnClickListener, View.OnLongClickListener {
|
|||
activity.performFavourite(
|
||||
access_info
|
||||
, status
|
||||
,ActMain.NOT_CROSS_ACCOUNT
|
||||
, ActMain.NOT_CROSS_ACCOUNT
|
||||
, ! status.favourited
|
||||
, bSimpleList ? activity.favourite_complete_callback : null
|
||||
);
|
||||
|
@ -202,7 +203,7 @@ class StatusButtons implements View.OnClickListener, View.OnLongClickListener {
|
|||
activity.openFollowFromAnotherAccount( access_info, status.account );
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case R.id.btnReply:
|
||||
activity.openReplyFromAnotherAccount( status );
|
||||
break;
|
||||
|
|
|
@ -3,6 +3,7 @@ package jp.juggler.subwaytooter;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.SystemClock;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.view.MotionEventCompat;
|
||||
import android.view.Gravity;
|
||||
import android.view.MotionEvent;
|
||||
|
@ -10,9 +11,7 @@ import android.view.View;
|
|||
import android.view.WindowManager;
|
||||
import android.widget.PopupWindow;
|
||||
|
||||
import jp.juggler.subwaytooter.api.entity.TootStatus;
|
||||
import jp.juggler.subwaytooter.api.entity.TootStatusLike;
|
||||
import jp.juggler.subwaytooter.api_msp.entity.MSPToot;
|
||||
import jp.juggler.subwaytooter.view.MyListView;
|
||||
|
||||
class StatusButtonsPopup {
|
||||
|
@ -35,7 +34,8 @@ class StatusButtonsPopup {
|
|||
}
|
||||
}
|
||||
|
||||
void show( final MyListView listView, View anchor, TootStatusLike status ){
|
||||
@SuppressLint("RtlHardcoded")
|
||||
void show( @NonNull final MyListView listView, @NonNull View anchor, @NonNull TootStatusLike status ){
|
||||
|
||||
//
|
||||
window = new PopupWindow( activity );
|
||||
|
|
|
@ -18,7 +18,6 @@ import jp.juggler.subwaytooter.util.Utils;
|
|||
|
||||
public class TootAccount {
|
||||
|
||||
|
||||
public static class List extends ArrayList< TootAccount > {
|
||||
|
||||
}
|
||||
|
@ -53,7 +52,8 @@ public class TootAccount {
|
|||
|
||||
// Biography of user
|
||||
// 説明文。改行は\r\n。リンクなどはHTMLタグで書かれている
|
||||
public Spannable note;
|
||||
public String note;
|
||||
public Spannable decoded_note;
|
||||
|
||||
//URL of the user's profile page (can be remote)
|
||||
// https://mastodon.juggler.jp/@tateisu
|
||||
|
@ -86,10 +86,10 @@ public class TootAccount {
|
|||
public static TootAccount parse( LogCategory log, LinkClickContext account, JSONObject src, TootAccount dst ){
|
||||
if( src == null ) return null;
|
||||
try{
|
||||
dst.id = src.optLong( "id",-1L );
|
||||
dst.id = src.optLong( "id", - 1L );
|
||||
dst.username = Utils.optStringX( src, "username" );
|
||||
dst.acct = Utils.optStringX( src, "acct" );
|
||||
if( dst.acct == null){
|
||||
if( dst.acct == null ){
|
||||
dst.acct = "?@?";
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ public class TootAccount {
|
|||
if( TextUtils.isEmpty( sv ) ){
|
||||
dst.display_name = dst.username;
|
||||
}else{
|
||||
dst.display_name = filterDisplayName(sv);
|
||||
dst.display_name = filterDisplayName( sv );
|
||||
}
|
||||
|
||||
dst.locked = src.optBoolean( "locked" );
|
||||
|
@ -105,7 +105,10 @@ public class TootAccount {
|
|||
dst.followers_count = src.optLong( "followers_count" );
|
||||
dst.following_count = src.optLong( "following_count" );
|
||||
dst.statuses_count = src.optLong( "statuses_count" );
|
||||
dst.note = HTMLDecoder.decodeHTML( account,Utils.optStringX( src, "note" ) ,true,null);
|
||||
|
||||
dst.note = Utils.optStringX( src, "note" );
|
||||
dst.decoded_note = HTMLDecoder.decodeHTML( account, ( dst.note != null ? dst.note : null ), true, null );
|
||||
|
||||
dst.url = Utils.optStringX( src, "url" );
|
||||
dst.avatar = Utils.optStringX( src, "avatar" ); // "https:\/\/mastodon.juggler.jp\/system\/accounts\/avatars\/000\/000\/148\/original\/0a468974fac5a448.PNG?1492081886",
|
||||
dst.avatar_static = Utils.optStringX( src, "avatar_static" ); // "https:\/\/mastodon.juggler.jp\/system\/accounts\/avatars\/000\/000\/148\/original\/0a468974fac5a448.PNG?1492081886",
|
||||
|
@ -123,20 +126,20 @@ public class TootAccount {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public static TootAccount parse( LogCategory log, LinkClickContext account,JSONObject src ){
|
||||
public static TootAccount parse( LogCategory log, LinkClickContext account, JSONObject src ){
|
||||
return parse( log, account, src, new TootAccount() );
|
||||
}
|
||||
|
||||
@NonNull public static List parseList( LogCategory log, LinkClickContext account, JSONArray array ){
|
||||
@NonNull
|
||||
public static List parseList( LogCategory log, LinkClickContext account, JSONArray array ){
|
||||
List result = new List();
|
||||
if( array != null ){
|
||||
int array_size = array.length();
|
||||
result.ensureCapacity( array_size );
|
||||
for( int i=0;i<array_size;++i){
|
||||
for( int i = 0 ; i < array_size ; ++ i ){
|
||||
JSONObject src = array.optJSONObject( i );
|
||||
if( src == null ) continue;
|
||||
TootAccount item = parse( log, account,src );
|
||||
TootAccount item = parse( log, account, src );
|
||||
if( item != null ) result.add( item );
|
||||
}
|
||||
}
|
||||
|
@ -144,22 +147,22 @@ public class TootAccount {
|
|||
}
|
||||
|
||||
public static CharSequence filterDisplayName( String sv ){
|
||||
|
||||
|
||||
// decode HTML entity
|
||||
sv = HTMLDecoder.decodeEntity(sv );
|
||||
|
||||
sv = HTMLDecoder.decodeEntity( sv );
|
||||
|
||||
// sanitize LRO,RLO
|
||||
sv = Utils.sanitizeBDI( sv);
|
||||
|
||||
sv = Utils.sanitizeBDI( sv );
|
||||
|
||||
// decode emoji code
|
||||
return Emojione.decodeEmoji( sv ) ;
|
||||
return Emojione.decodeEmoji( sv );
|
||||
}
|
||||
|
||||
public String getAcctHost(){
|
||||
try{
|
||||
int pos = acct.indexOf( '@' );
|
||||
if( pos != - 1 ) return acct.substring( pos + 1 );
|
||||
}catch(Throwable ignored){
|
||||
}catch( Throwable ignored ){
|
||||
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
package jp.juggler.subwaytooter.api_msp.entity;
|
||||
|
||||
import jp.juggler.subwaytooter.api.entity.TootAccount;
|
||||
|
||||
public class MSPAccount extends TootAccount {
|
||||
}
|
|
@ -29,7 +29,7 @@ public class MSPToot extends TootStatusLike {
|
|||
|
||||
if( src == null ) return null;
|
||||
|
||||
TootAccount dst = new TootAccount();
|
||||
MSPAccount dst = new MSPAccount();
|
||||
dst.url = Utils.optStringX( src, "url" );
|
||||
dst.username = Utils.optStringX( src, "username" );
|
||||
dst.avatar = dst.avatar_static = Utils.optStringX( src, "avatar" );
|
||||
|
@ -42,7 +42,10 @@ public class MSPToot extends TootStatusLike {
|
|||
}
|
||||
|
||||
dst.id = src.optLong( "id" );
|
||||
dst.note = HTMLDecoder.decodeHTML( access_info, Utils.optStringX( src, "note" ), true, null );
|
||||
|
||||
dst.note = Utils.optStringX( src, "note" );
|
||||
dst.decoded_note = HTMLDecoder.decodeHTML( access_info,(dst.note!=null? dst.note :null) ,true,null);
|
||||
|
||||
|
||||
if( TextUtils.isEmpty( dst.url ) ){
|
||||
log.e( "parseAccount: missing url" );
|
||||
|
|
|
@ -417,18 +417,27 @@ public class SavedAccount extends TootAccount implements LinkClickContext {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getFullAcct( @Nullable TootAccount who ){
|
||||
return who == null ? "?@?" : getFullAcct( who.acct );
|
||||
public @NonNull String getAccountHost( @Nullable String acct ){
|
||||
if( acct != null ){
|
||||
int pos = acct.indexOf( '@' );
|
||||
if( pos != - 1 ) return acct.substring( pos + 1 );
|
||||
}
|
||||
return this.host;
|
||||
}
|
||||
public @NonNull String getAccountHost( @Nullable TootAccount who ){
|
||||
if( who != null ) return getAccountHost( who.acct );
|
||||
return this.host;
|
||||
}
|
||||
|
||||
public @NonNull String getFullAcct( @NonNull String acct ){
|
||||
return acct.indexOf( '@' ) != - 1 ? acct : acct + "@" + this.host;
|
||||
}
|
||||
|
||||
public String getFullAcct( @NonNull String acct ){
|
||||
if( - 1 != acct.indexOf( '@' ) ){
|
||||
return acct;
|
||||
}else{
|
||||
return acct + "@" + this.host;
|
||||
public String getFullAcct( @Nullable TootAccount who ){
|
||||
if( who != null && who.acct != null ){
|
||||
return getFullAcct( who.acct );
|
||||
}
|
||||
return "?@?";
|
||||
}
|
||||
|
||||
public String getUserUrl( @NonNull String who_acct ){
|
||||
|
|
|
@ -1001,7 +1001,8 @@ public class Utils {
|
|||
Uri uri = Uri.parse( path );
|
||||
if( "file".equals( uri.getScheme() ) ) return new File( uri.getPath() );
|
||||
|
||||
if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT ){
|
||||
// if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT )
|
||||
{
|
||||
if( isExternalStorageDocument( uri ) ){
|
||||
try{
|
||||
final String docId = getDocumentId( uri );
|
||||
|
|
|
@ -304,6 +304,20 @@
|
|||
android:text="@string/open_web_page"
|
||||
android:textAllCaps="false"
|
||||
/>
|
||||
<Button
|
||||
android:id="@+id/btnAccountText"
|
||||
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/select_and_copy"
|
||||
android:textAllCaps="false"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnFollowRequestOK"
|
||||
|
@ -397,6 +411,21 @@
|
|||
android:textAllCaps="false"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnOpenTimeline"
|
||||
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:textAllCaps="false"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnNickname"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llColumnHeader"
|
||||
|
@ -113,7 +114,6 @@
|
|||
android:src="?attr/btn_close"
|
||||
/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -185,12 +185,14 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:text="@string/hide_media_default"
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbEnableSpeech"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/enable_speech"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llRegexFilter"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -245,14 +247,14 @@
|
|||
</jp.juggler.subwaytooter.view.MaxHeightScrollView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSearchDesc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorSearchFormBackground"
|
||||
android:paddingBottom="0dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingTop="3dp"
|
||||
android:background="?attr/colorSearchFormBackground"
|
||||
android:id="@+id/tvSearchDesc"
|
||||
/>
|
||||
|
||||
<RelativeLayout
|
||||
|
@ -284,7 +286,8 @@
|
|||
android:layout_toStartOf="@id/btnSearch"
|
||||
android:imeOptions="actionSearch"
|
||||
android:inputType="text"
|
||||
tools:ignore="LabelFor"/>
|
||||
tools:ignore="LabelFor"
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbResolve"
|
||||
|
@ -307,9 +310,9 @@
|
|||
android:id="@+id/ivColumnBackgroundImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:importantForAccessibility="no"
|
||||
android:scaleType="centerCrop"
|
||||
android:visibility="gone"
|
||||
android:importantForAccessibility="no"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
|
@ -323,7 +326,8 @@
|
|||
android:id="@+id/swipyRefreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:srl_direction="both">
|
||||
app:srl_direction="both"
|
||||
>
|
||||
|
||||
<jp.juggler.subwaytooter.view.MyListView
|
||||
android:id="@+id/listView"
|
||||
|
|
|
@ -1 +1 @@
|
|||
powered by <a href="http://mastodonsearch.jp/">Mastodon Search Portal</a>, it indexes toots of instances in Japan.<br/>If you want to remove your toot from search result, please contact to <a href="https://mstdn.jp/@mastodonsearch">@mastodonsearch@mstdn.jp</a>.
|
||||
powered by <a href="http://mastodonsearch.jp/">Mastodon Search Portal</a>, it indexes toots of instances in Japan.<br/>If you want to remove your toot from search result, please contact to <a href="https://mstdn.jp/@mastodonsearch">@mastodonsearch@mstdn.jp</a>.
|
|
@ -1 +1 @@
|
|||
powered by <a href="http://mastodonsearch.jp/">マストドン検索ポータル</a><br/>検索結果からあなたのトゥートを除外したい場合、<a href="https://mstdn.jp/@mastodonsearch">@mastodonsearch@mstdn.jp</a>に連絡してください。
|
||||
powered by <a href="http://mastodonsearch.jp/">マストドン検索ポータル</a><br/>検索結果からあなたのトゥートを除外したい場合、<a href="https://mstdn.jp/@mastodonsearch">@mastodonsearch@mstdn.jp</a>に連絡してください。
|
File diff suppressed because it is too large
Load Diff
|
@ -371,6 +371,19 @@
|
|||
<string name="search_desc_mastodon_api">Account/Hashtag search using Mastodon API.</string>
|
||||
<string name="toot_search_of">Toot Rechercher \"%1$s\"</string>
|
||||
<string name="progress_synchronize_toot">Syncing Toot…</string>
|
||||
<string name="send_header_account_name">Account-Name</string>
|
||||
<string name="send_header_account_acct">Account-Acct</string>
|
||||
<string name="send_header_account_created_at">Account-Created-At</string>
|
||||
<string name="send_header_account_statuses_count">Account-Statuses-Count</string>
|
||||
<string name="send_header_account_followers_count">Account-Followers-Count</string>
|
||||
<string name="send_header_account_following_count">Account-Following-Count</string>
|
||||
<string name="send_header_account_locked">Account-Locked</string>
|
||||
<string name="send_header_account_image_avatar">Account-Image-Avatar</string>
|
||||
<string name="send_header_account_image_avatar_static">Account-Image-Avatar-Static</string>
|
||||
<string name="send_header_account_image_header">Account-Image-Header</string>
|
||||
<string name="send_header_account_image_header_static">Account-Image-Header-Static</string>
|
||||
<string name="open_local_timeline_for">Open timeline of \"%1$s\"</string>
|
||||
<string name="send_header_account_url">Account-Url</string>
|
||||
|
||||
<!--<string name="abc_action_bar_home_description">Revenir à l\'accueil</string>-->
|
||||
<!--<string name="abc_action_bar_home_description_format">%1$s, %2$s</string>-->
|
||||
|
|
|
@ -264,7 +264,7 @@
|
|||
<!---->
|
||||
<string name="confirm_close_column">このカラムを閉じますか?</string>
|
||||
<!---->
|
||||
<string name="follow_from_another_account">別のアカウントでフォロー</string>
|
||||
<string name="follow_from_another_account">別アカウントでフォロー</string>
|
||||
<!---->
|
||||
<string name="favourite_from_another_account">別アカウントでお気に入り</string>
|
||||
<!---->
|
||||
|
@ -658,5 +658,18 @@
|
|||
<string name="search_desc_mastodon_api">アカウントやハッシュタグをマストドンのAPIで検索します。</string>
|
||||
<string name="toot_search_of">トゥート検索:%1$s</string>
|
||||
<string name="progress_synchronize_toot">トゥートを同期してます…</string>
|
||||
<string name="send_header_account_name">Account-Name</string>
|
||||
<string name="send_header_account_acct">Account-Acct</string>
|
||||
<string name="send_header_account_created_at">Account-Created-At</string>
|
||||
<string name="send_header_account_statuses_count">Account-Statuses-Count</string>
|
||||
<string name="send_header_account_followers_count">Account-Followers-Count</string>
|
||||
<string name="send_header_account_following_count">Account-Following-Count</string>
|
||||
<string name="send_header_account_locked">Account-Locked</string>
|
||||
<string name="send_header_account_image_avatar">Account-Image-Avatar</string>
|
||||
<string name="send_header_account_image_avatar_static">Account-Image-Avatar-Static</string>
|
||||
<string name="send_header_account_image_header">Account-Image-Header</string>
|
||||
<string name="send_header_account_image_header_static">Account-Image-Header-Static</string>
|
||||
<string name="send_header_account_url">Account-Url</string>
|
||||
<string name="open_local_timeline_for">\"%1$s\"のタイムラインを開く</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -366,5 +366,18 @@
|
|||
<string name="search_desc_mastodon_api">Account/Hashtag search using Mastodon API.</string>
|
||||
<string name="toot_search_of">Toot search \"%1$s\"</string>
|
||||
<string name="progress_synchronize_toot">Syncing Toot…</string>
|
||||
<string name="send_header_account_name">Account-Name</string>
|
||||
<string name="send_header_account_acct">Account-Acct</string>
|
||||
<string name="send_header_account_url">Account-Url</string>
|
||||
<string name="send_header_account_created_at">Account-Created-At</string>
|
||||
<string name="send_header_account_statuses_count">Account-Statuses-Count</string>
|
||||
<string name="send_header_account_followers_count">Account-Followers-Count</string>
|
||||
<string name="send_header_account_following_count">Account-Following-Count</string>
|
||||
<string name="send_header_account_locked">Account-Locked</string>
|
||||
<string name="send_header_account_image_avatar">Account-Image-Avatar</string>
|
||||
<string name="send_header_account_image_avatar_static">Account-Image-Avatar-Static</string>
|
||||
<string name="send_header_account_image_header">Account-Image-Header</string>
|
||||
<string name="send_header_account_image_header_static">Account-Image-Header-Static</string>
|
||||
<string name="open_local_timeline_for">Open timeline of \"%1$s\"</string>
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Reference in New Issue