Some fixes

This commit is contained in:
tom79 2019-10-13 11:00:38 +02:00
parent aea157a429
commit f0ebcf7a90
5 changed files with 17 additions and 10 deletions

View File

@ -61,7 +61,6 @@ ext.evernoteLibraryVersion = '1.3.0-rc1'
ext.gsonLibraryVersion = '2.8.2'
ext.guavaLibraryVersion = '24.1-android'
ext.photoViewLibraryVersion = '2.3.0'
ext.swipebackLibraryVersion = '1.0.3'
ext.ratethisappLibraryVersion = '1.2.0'
ext.uploadServiceVersion = "3.5.2"
ext.torrentstreamVersion = "2.5.0"

View File

@ -36,6 +36,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.appcompat.app.ActionBar;
@ -80,7 +81,7 @@ public class SlideMediaActivity extends BaseActivity implements OnDownloadInterf
private ViewPager mPager;
private long downloadID;
private boolean fullscreen;
public SlidrInterface slidrInterface;
private SlidrInterface slidrInterface;
int flags;
private TextView media_description;
private Handler handler;
@ -104,7 +105,7 @@ public class SlideMediaActivity extends BaseActivity implements OnDownloadInterf
setTheme(R.style.TransparentDark);
}
setContentView(R.layout.activity_media_pager);
CoordinatorLayout swipeBackLayout = findViewById(R.id.swipeBackLayout);
RelativeLayout swipeBackLayout = findViewById(R.id.swipeBackLayout);
if (theme == Helper.THEME_LIGHT) {
swipeBackLayout.setBackgroundResource(R.color.white);
} else if (theme == Helper.THEME_BLACK) {
@ -116,11 +117,7 @@ public class SlideMediaActivity extends BaseActivity implements OnDownloadInterf
media_description = findViewById(R.id.media_description);
flags = getWindow().getDecorView().getSystemUiVisibility();
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
@ -388,6 +385,14 @@ public class SlideMediaActivity extends BaseActivity implements OnDownloadInterf
super.onPostResume();
}
public void enableSliding(boolean enable){
if (enable)
slidrInterface.unlock();
else
slidrInterface.lock();
}
public boolean getFullScreen(){
return this.fullscreen;
}

View File

@ -481,7 +481,7 @@ public class PixelfedListAdapter extends RecyclerView.Adapter implements OnPostA
Intent intent = new Intent(context, SlideMediaActivity.class);
Bundle b = new Bundle();
intent.putParcelableArrayListExtra("mediaArray", status.getMedia_attachments());
b.putInt("position", 0);
b.putInt("position", 1);
intent.putExtras(b);
context.startActivity(intent);
}

View File

@ -164,6 +164,9 @@ public class MediaSliderFragment extends Fragment implements MediaPlayer.OnCompl
if( ! ((SlideMediaActivity)context).getFullScreen()) {
((SlideMediaActivity) context).setFullscreen(true);
}
((SlideMediaActivity) context).enableSliding(false);
}else{
((SlideMediaActivity) context).enableSliding(true);
}
}
});

View File

@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>.
-->
<androidx.coordinatorlayout.widget.CoordinatorLayout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:animateLayoutChanges="true"
android:id="@+id/swipeBackLayout"
@ -37,4 +37,4 @@
android:padding="12dp"
android:background="#AA000000"
android:textColor="#ffffffff" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</RelativeLayout>