Merge remote-tracking branch 'mastodon/master'
# Conflicts: # mastodon/build.gradle # mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java
This commit is contained in:
@@ -118,8 +118,8 @@ dependencies {
|
|||||||
implementation 'me.grishka.litex:viewpager:1.0.0'
|
implementation 'me.grishka.litex:viewpager:1.0.0'
|
||||||
implementation 'me.grishka.litex:viewpager2:1.0.0'
|
implementation 'me.grishka.litex:viewpager2:1.0.0'
|
||||||
implementation 'me.grishka.litex:palette:1.0.0'
|
implementation 'me.grishka.litex:palette:1.0.0'
|
||||||
implementation 'me.grishka.appkit:appkit:1.2.9'
|
implementation 'me.grishka.appkit:appkit:1.2.13'
|
||||||
implementation 'com.google.code.gson:gson:2.9.0'
|
implementation 'com.google.code.gson:gson:2.8.9'
|
||||||
implementation 'org.jsoup:jsoup:1.14.3'
|
implementation 'org.jsoup:jsoup:1.14.3'
|
||||||
implementation 'com.squareup:otto:1.3.8'
|
implementation 'com.squareup:otto:1.3.8'
|
||||||
implementation 'de.psdev:async-otto:1.0.3'
|
implementation 'de.psdev:async-otto:1.0.3'
|
||||||
|
|||||||
@@ -361,7 +361,6 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
pager.setUserInputEnabled(!GlobalUserPreferences.disableSwipe);
|
pager.setUserInputEnabled(!GlobalUserPreferences.disableSwipe);
|
||||||
pager.setAdapter(new ProfilePagerAdapter());
|
pager.setAdapter(new ProfilePagerAdapter());
|
||||||
pager.getLayoutParams().height=getResources().getDisplayMetrics().heightPixels;
|
pager.getLayoutParams().height=getResources().getDisplayMetrics().heightPixels;
|
||||||
pager.setVisibility(View.GONE); // Prevents a strange NPE when search is opened on the search tab. Shown in onShown()
|
|
||||||
|
|
||||||
scrollView.setScrollableChildSupplier(this::getScrollableRecyclerView);
|
scrollView.setScrollableChildSupplier(this::getScrollableRecyclerView);
|
||||||
scrollView.getViewTreeObserver().addOnGlobalLayoutListener(this::updateMetadataHeight);
|
scrollView.getViewTreeObserver().addOnGlobalLayoutListener(this::updateMetadataHeight);
|
||||||
@@ -756,7 +755,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
followingCount.setText(UiUtils.abbreviateNumber(account.followingCount));
|
followingCount.setText(UiUtils.abbreviateNumber(account.followingCount));
|
||||||
followersLabel.setText(getResources().getQuantityString(R.plurals.followers, (int)Math.min(999, account.followersCount)));
|
followersLabel.setText(getResources().getQuantityString(R.plurals.followers, (int)Math.min(999, account.followersCount)));
|
||||||
followingLabel.setText(getResources().getQuantityString(R.plurals.following, (int)Math.min(999, account.followingCount)));
|
followingLabel.setText(getResources().getQuantityString(R.plurals.following, (int)Math.min(999, account.followingCount)));
|
||||||
|
|
||||||
if (account.followersCount < 0) followersBtn.setVisibility(View.GONE);
|
if (account.followersCount < 0) followersBtn.setVisibility(View.GONE);
|
||||||
if (account.followingCount < 0) followingBtn.setVisibility(View.GONE);
|
if (account.followingCount < 0) followingBtn.setVisibility(View.GONE);
|
||||||
if (account.followersCount < 0 || account.followingCount < 0)
|
if (account.followersCount < 0 || account.followingCount < 0)
|
||||||
@@ -1425,19 +1424,11 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
return actionButton.getVisibility()==View.VISIBLE && actionButtonWrap.getTop()+actionButtonWrap.getHeight()>scrollView.getScrollY();
|
return actionButton.getVisibility()==View.VISIBLE && actionButtonWrap.getTop()+actionButtonWrap.getHeight()>scrollView.getScrollY();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onShown(){
|
|
||||||
super.onShown();
|
|
||||||
pager.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class ProfilePagerAdapter extends RecyclerView.Adapter<SimpleViewHolder>{
|
private class ProfilePagerAdapter extends RecyclerView.Adapter<SimpleViewHolder>{
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public SimpleViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){
|
public SimpleViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType){
|
||||||
FrameLayout view=tabViews[viewType];
|
FrameLayout view=new FrameLayout(parent.getContext());
|
||||||
if (view.getParent() != null) ((ViewGroup)view.getParent()).removeView(view);
|
|
||||||
view.setVisibility(View.VISIBLE);
|
|
||||||
view.setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
view.setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||||
return new SimpleViewHolder(view);
|
return new SimpleViewHolder(view);
|
||||||
}
|
}
|
||||||
@@ -1445,8 +1436,13 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull SimpleViewHolder holder, int position){
|
public void onBindViewHolder(@NonNull SimpleViewHolder holder, int position){
|
||||||
Fragment fragment=getFragmentForPage(position);
|
Fragment fragment=getFragmentForPage(position);
|
||||||
|
FrameLayout fragmentView=tabViews[position];
|
||||||
|
fragmentView.setVisibility(View.VISIBLE);
|
||||||
|
if(fragmentView.getParent() instanceof ViewGroup parent)
|
||||||
|
parent.removeView(fragmentView);
|
||||||
|
((FrameLayout)holder.itemView).addView(fragmentView);
|
||||||
if(!fragment.isAdded()){
|
if(!fragment.isAdded()){
|
||||||
getChildFragmentManager().beginTransaction().add(holder.itemView.getId(), fragment).commit();
|
getChildFragmentManager().beginTransaction().add(fragmentView.getId(), fragment).commit();
|
||||||
holder.itemView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
|
holder.itemView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreDraw(){
|
public boolean onPreDraw(){
|
||||||
|
|||||||
@@ -119,6 +119,9 @@ public class ZoomPanView extends FrameLayout implements ScaleGestureDetector.OnS
|
|||||||
|
|
||||||
int width=right-left;
|
int width=right-left;
|
||||||
int height=bottom-top;
|
int height=bottom-top;
|
||||||
|
if(width==0 || height==0)
|
||||||
|
return;
|
||||||
|
|
||||||
float scale=Math.min(width/(float)child.getWidth(), height/(float)child.getHeight());
|
float scale=Math.min(width/(float)child.getWidth(), height/(float)child.getHeight());
|
||||||
minScale=scale;
|
minScale=scale;
|
||||||
maxScale=Math.max(3f, height/(float)child.getHeight());
|
maxScale=Math.max(3f, height/(float)child.getHeight());
|
||||||
@@ -306,8 +309,6 @@ public class ZoomPanView extends FrameLayout implements ScaleGestureDetector.OnS
|
|||||||
}, 1f).setMinimumVisibleChange(DynamicAnimation.MIN_VISIBLE_CHANGE_ALPHA));
|
}, 1f).setMinimumVisibleChange(DynamicAnimation.MIN_VISIBLE_CHANGE_ALPHA));
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(animatingTransition)
|
|
||||||
Log.w(TAG, "updateViewTransform: ", new Throwable().fillInStackTrace());
|
|
||||||
child.setScaleX(matrixValues[Matrix.MSCALE_X]);
|
child.setScaleX(matrixValues[Matrix.MSCALE_X]);
|
||||||
child.setScaleY(matrixValues[Matrix.MSCALE_Y]);
|
child.setScaleY(matrixValues[Matrix.MSCALE_Y]);
|
||||||
child.setTranslationX(matrixValues[Matrix.MTRANS_X]);
|
child.setTranslationX(matrixValues[Matrix.MTRANS_X]);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class MediaGridLayout extends ViewGroup{
|
|||||||
|
|
||||||
private static final int GAP=2; // dp
|
private static final int GAP=2; // dp
|
||||||
private PhotoLayoutHelper.TiledLayoutResult tiledLayout;
|
private PhotoLayoutHelper.TiledLayoutResult tiledLayout;
|
||||||
private int[] columnStarts=new int[10], columnEnds=new int[10], rowStarts=new int[10], rowEnds=new int[10];
|
private int[] columnStarts, columnEnds, rowStarts, rowEnds;
|
||||||
|
|
||||||
public MediaGridLayout(Context context){
|
public MediaGridLayout(Context context){
|
||||||
this(context, null);
|
this(context, null);
|
||||||
@@ -41,6 +41,14 @@ public class MediaGridLayout extends ViewGroup{
|
|||||||
width=Math.round(width*(tiledLayout.width/(float)PhotoLayoutHelper.MAX_WIDTH));
|
width=Math.round(width*(tiledLayout.width/(float)PhotoLayoutHelper.MAX_WIDTH));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(rowStarts==null || rowStarts.length<tiledLayout.rowSizes.length){
|
||||||
|
rowStarts=new int[tiledLayout.rowSizes.length];
|
||||||
|
rowEnds=new int[tiledLayout.rowSizes.length];
|
||||||
|
}
|
||||||
|
if(columnStarts==null || columnStarts.length<tiledLayout.columnSizes.length){
|
||||||
|
columnStarts=new int[tiledLayout.columnSizes.length];
|
||||||
|
columnEnds=new int[tiledLayout.columnSizes.length];
|
||||||
|
}
|
||||||
int offset=0;
|
int offset=0;
|
||||||
for(int i=0;i<tiledLayout.columnSizes.length;i++){
|
for(int i=0;i<tiledLayout.columnSizes.length;i++){
|
||||||
columnStarts[i]=offset;
|
columnStarts[i]=offset;
|
||||||
@@ -73,7 +81,7 @@ public class MediaGridLayout extends ViewGroup{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onLayout(boolean changed, int l, int t, int r, int b){
|
protected void onLayout(boolean changed, int l, int t, int r, int b){
|
||||||
if(tiledLayout==null)
|
if(tiledLayout==null || rowStarts==null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int maxWidth=UiUtils.MAX_WIDTH;
|
int maxWidth=UiUtils.MAX_WIDTH;
|
||||||
|
|||||||
@@ -4,12 +4,14 @@
|
|||||||
<string name="next">Seguinte</string>
|
<string name="next">Seguinte</string>
|
||||||
<string name="loading_instance">Obtendo info do servidor…</string>
|
<string name="loading_instance">Obtendo info do servidor…</string>
|
||||||
<string name="error">Erro</string>
|
<string name="error">Erro</string>
|
||||||
|
<string name="not_a_mastodon_instance">%s non semella ser un servidor Mastodon.</string>
|
||||||
<string name="ok">OK</string>
|
<string name="ok">OK</string>
|
||||||
<string name="preparing_auth">Preparándose para a autenticación…</string>
|
<string name="preparing_auth">Preparándose para a autenticación…</string>
|
||||||
<string name="finishing_auth">Rematando coa autenticación…</string>
|
<string name="finishing_auth">Rematando coa autenticación…</string>
|
||||||
<string name="user_boosted">%s promoveu</string>
|
<string name="user_boosted">%s promoveu</string>
|
||||||
<string name="in_reply_to">Como resposta a %s</string>
|
<string name="in_reply_to">Como resposta a %s</string>
|
||||||
<string name="notifications">Notificacións</string>
|
<string name="notifications">Notificacións</string>
|
||||||
|
<string name="user_followed_you">%s comezou a seguirte</string>
|
||||||
<string name="share_toot_title">Compartir</string>
|
<string name="share_toot_title">Compartir</string>
|
||||||
<string name="settings">Axustes</string>
|
<string name="settings">Axustes</string>
|
||||||
<string name="publish">Publicar</string>
|
<string name="publish">Publicar</string>
|
||||||
|
|||||||
@@ -643,7 +643,7 @@
|
|||||||
<!-- %s is the name of the post language -->
|
<!-- %s is the name of the post language -->
|
||||||
<string name="translate_post">Перевести %s</string>
|
<string name="translate_post">Перевести %s</string>
|
||||||
<!-- %1$s is the language, %2$s is the name of the translation service -->
|
<!-- %1$s is the language, %2$s is the name of the translation service -->
|
||||||
<string name="post_translated">Переведено с %1$s с помощью %2$s</string>
|
<string name="post_translated">%1$s переведён с помощью %2$s</string>
|
||||||
<string name="translation_show_original">Показать оригинал</string>
|
<string name="translation_show_original">Показать оригинал</string>
|
||||||
<string name="translation_failed">Перевод не удался. Возможно, администратор не включил переводы на этом сервере или на этом сервере установлена более старая версия Mastodon, где переводы еще не поддерживаются.</string>
|
<string name="translation_failed">Перевод не удался. Возможно, администратор не включил переводы на этом сервере или на этом сервере установлена более старая версия Mastodon, где переводы еще не поддерживаются.</string>
|
||||||
<string name="settings_privacy">Приватность и доступ</string>
|
<string name="settings_privacy">Приватность и доступ</string>
|
||||||
|
|||||||
@@ -641,5 +641,24 @@
|
|||||||
<string name="time_hours_ago_short">%dгод. тому</string>
|
<string name="time_hours_ago_short">%dгод. тому</string>
|
||||||
<string name="time_days_ago_short">%dд. тому</string>
|
<string name="time_days_ago_short">%dд. тому</string>
|
||||||
<!-- %s is the name of the post language -->
|
<!-- %s is the name of the post language -->
|
||||||
|
<string name="translate_post">Перекласти з %s</string>
|
||||||
<!-- %1$s is the language, %2$s is the name of the translation service -->
|
<!-- %1$s is the language, %2$s is the name of the translation service -->
|
||||||
|
<string name="post_translated">Перекладено з %1$s за допомогою %2$s</string>
|
||||||
|
<string name="translation_show_original">Показати оригінал</string>
|
||||||
|
<string name="translation_failed">Не вдалося виконати переклад. Можливо, адміністратор не активував переклади на цьому сервері або цей сервер використовує стару версію Mastodon, де переклади ще не підтримуються.</string>
|
||||||
|
<string name="settings_privacy">Приватність і досяжність</string>
|
||||||
|
<string name="settings_discoverable">Враховувати профіль та дописи в алгоритмах пошуку</string>
|
||||||
|
<string name="settings_indexable">Включити загальнодоступні дописи в результати пошуку</string>
|
||||||
|
<plurals name="x_participants">
|
||||||
|
<item quantity="one">%,d учасник</item>
|
||||||
|
<item quantity="few">%,d учасники</item>
|
||||||
|
<item quantity="many">%,d учасників</item>
|
||||||
|
<item quantity="other">%,d учасника</item>
|
||||||
|
</plurals>
|
||||||
|
<plurals name="x_posts_today">
|
||||||
|
<item quantity="one">%,d допис сьогодні</item>
|
||||||
|
<item quantity="few">%,d дописи сьогодні</item>
|
||||||
|
<item quantity="many">%,d дописів сьогодні</item>
|
||||||
|
<item quantity="other">%,d дописа сьогодні</item>
|
||||||
|
</plurals>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user