Resolves merge conflicts
This commit is contained in:
commit
7f934e4f26
4 changed files with 46 additions and 40 deletions
|
@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 25
|
compileSdkVersion 25
|
||||||
buildToolsVersion "25.0.2"
|
buildToolsVersion "25.0.3"
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.keylesspalace.tusky"
|
applicationId "com.keylesspalace.tusky"
|
||||||
minSdkVersion 15
|
minSdkVersion 15
|
||||||
|
@ -37,7 +37,7 @@ dependencies {
|
||||||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
|
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
|
||||||
exclude group: 'com.android.support', module: 'support-annotations'
|
exclude group: 'com.android.support', module: 'support-annotations'
|
||||||
})
|
})
|
||||||
compile('com.mikepenz:materialdrawer:5.8.2@aar') {
|
compile('com.mikepenz:materialdrawer:5.9.1@aar') {
|
||||||
transitive = true
|
transitive = true
|
||||||
}
|
}
|
||||||
compile 'com.android.support:appcompat-v7:25.3.1'
|
compile 'com.android.support:appcompat-v7:25.3.1'
|
||||||
|
@ -47,22 +47,22 @@ dependencies {
|
||||||
compile 'com.android.support:design:25.3.1'
|
compile 'com.android.support:design:25.3.1'
|
||||||
compile 'com.android.support:exifinterface:25.3.1'
|
compile 'com.android.support:exifinterface:25.3.1'
|
||||||
compile 'com.squareup.retrofit2:retrofit:2.2.0'
|
compile 'com.squareup.retrofit2:retrofit:2.2.0'
|
||||||
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
|
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
|
||||||
compile 'com.squareup.picasso:picasso:2.5.2'
|
compile 'com.squareup.picasso:picasso:2.5.2'
|
||||||
compile 'com.squareup.okhttp3:okhttp:3.7.0'
|
compile 'com.squareup.okhttp3:okhttp:3.7.0'
|
||||||
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
|
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
|
||||||
compile 'com.pkmmte.view:circularimageview:1.1'
|
compile 'com.pkmmte.view:circularimageview:1.1'
|
||||||
compile 'com.github.peter9870:sparkbutton:master'
|
compile 'com.github.varunest:sparkbutton:1.0.5'
|
||||||
compile 'com.mikhaellopez:circularfillableloaders:1.2.0'
|
compile 'com.mikhaellopez:circularfillableloaders:1.2.0'
|
||||||
compile 'com.github.chrisbanes:PhotoView:1.3.1'
|
compile 'com.github.chrisbanes:PhotoView:2.0.0'
|
||||||
compile 'com.mikepenz:google-material-typeface:3.0.1.0.original@aar'
|
compile 'com.mikepenz:google-material-typeface:3.0.1.0.original@aar'
|
||||||
compile 'com.github.arimorty:floatingsearchview:2.0.4'
|
compile 'com.github.arimorty:floatingsearchview:2.0.4'
|
||||||
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0'
|
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.3'
|
||||||
compile 'com.jakewharton:butterknife:8.4.0'
|
compile 'com.jakewharton:butterknife:8.5.1'
|
||||||
googleCompile 'com.google.firebase:firebase-messaging:10.0.1'
|
googleCompile 'com.google.firebase:firebase-messaging:10.2.4'
|
||||||
googleCompile 'com.google.firebase:firebase-crash:10.0.1'
|
googleCompile 'com.google.firebase:firebase-crash:10.2.4'
|
||||||
testCompile 'junit:junit:4.12'
|
testCompile 'junit:junit:4.12'
|
||||||
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
|
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
|
@ -307,6 +307,12 @@ class StatusViewHolder extends RecyclerView.ViewHolder {
|
||||||
listener.onReblog(!reblogged, position);
|
listener.onReblog(!reblogged, position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEventAnimationEnd(ImageView button, boolean buttonState) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEventAnimationStart(ImageView button, boolean buttonState) {}
|
||||||
});
|
});
|
||||||
favouriteButton.setEventListener(new SparkEventListener() {
|
favouriteButton.setEventListener(new SparkEventListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -316,6 +322,12 @@ class StatusViewHolder extends RecyclerView.ViewHolder {
|
||||||
listener.onFavourite(!favourited, position);
|
listener.onFavourite(!favourited, position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEventAnimationEnd(ImageView button, boolean buttonState) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEventAnimationStart(ImageView button, boolean buttonState) {}
|
||||||
});
|
});
|
||||||
moreButton.setOnClickListener(new View.OnClickListener() {
|
moreButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -35,8 +35,13 @@ import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
|
||||||
import com.keylesspalace.tusky.R;
|
import com.keylesspalace.tusky.R;
|
||||||
|
import com.github.chrisbanes.photoview.OnOutsidePhotoTapListener;
|
||||||
|
import com.github.chrisbanes.photoview.OnSingleFlingListener;
|
||||||
|
import com.github.chrisbanes.photoview.PhotoView;
|
||||||
|
import com.github.chrisbanes.photoview.PhotoViewAttacher;
|
||||||
import com.squareup.picasso.Callback;
|
import com.squareup.picasso.Callback;
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
|
|
||||||
|
@ -44,17 +49,15 @@ import java.io.File;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import uk.co.senab.photoview.PhotoView;
|
|
||||||
import uk.co.senab.photoview.PhotoViewAttacher;
|
|
||||||
|
|
||||||
public class ViewMediaFragment extends DialogFragment {
|
public class ViewMediaFragment extends DialogFragment {
|
||||||
|
|
||||||
private PhotoViewAttacher attacher;
|
private PhotoViewAttacher attacher;
|
||||||
private DownloadManager downloadManager;
|
|
||||||
|
|
||||||
private static final int PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE = 1;
|
private static final int PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE = 1;
|
||||||
|
|
||||||
@BindView(R.id.view_media_image) PhotoView photoView;
|
@BindView(R.id.view_media_image)
|
||||||
|
PhotoView photoView;
|
||||||
|
|
||||||
public static ViewMediaFragment newInstance(String url) {
|
public static ViewMediaFragment newInstance(String url) {
|
||||||
Bundle arguments = new Bundle();
|
Bundle arguments = new Bundle();
|
||||||
|
@ -91,21 +94,16 @@ public class ViewMediaFragment extends DialogFragment {
|
||||||
attacher = new PhotoViewAttacher(photoView);
|
attacher = new PhotoViewAttacher(photoView);
|
||||||
|
|
||||||
// Clicking outside the photo closes the viewer.
|
// Clicking outside the photo closes the viewer.
|
||||||
attacher.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
|
attacher.setOnOutsidePhotoTapListener(new OnOutsidePhotoTapListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPhotoTap(View view, float x, float y) {
|
public void onOutsidePhotoTap(ImageView imageView) {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onOutsidePhotoTap() {
|
|
||||||
dismiss();
|
dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/* A vertical swipe motion also closes the viewer. This is especially useful when the photo
|
/* A vertical swipe motion also closes the viewer. This is especially useful when the photo
|
||||||
* mostly fills the screen so clicking outside is difficult. */
|
* mostly fills the screen so clicking outside is difficult. */
|
||||||
attacher.setOnSingleFlingListener(new PhotoViewAttacher.OnSingleFlingListener() {
|
attacher.setOnSingleFlingListener(new OnSingleFlingListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
|
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
|
||||||
float velocityY) {
|
float velocityY) {
|
||||||
|
@ -154,12 +152,6 @@ public class ViewMediaFragment extends DialogFragment {
|
||||||
return rootView;
|
return rootView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroyView() {
|
|
||||||
attacher.cleanup();
|
|
||||||
super.onDestroyView();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void downloadImage(){
|
private void downloadImage(){
|
||||||
|
|
||||||
//Permission stuff
|
//Permission stuff
|
||||||
|
@ -172,14 +164,13 @@ public class ViewMediaFragment extends DialogFragment {
|
||||||
PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE);
|
PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
||||||
//download stuff
|
//download stuff
|
||||||
String url = getArguments().getString("url");
|
String url = getArguments().getString("url");
|
||||||
Uri uri = Uri.parse(url);
|
Uri uri = Uri.parse(url);
|
||||||
|
|
||||||
String filename = new File(url).getName();
|
String filename = new File(url).getName();
|
||||||
|
|
||||||
downloadManager = (DownloadManager) getContext().getSystemService(Context.DOWNLOAD_SERVICE);
|
DownloadManager downloadManager = (DownloadManager) getContext().getSystemService(Context.DOWNLOAD_SERVICE);
|
||||||
|
|
||||||
DownloadManager.Request request = new DownloadManager.Request(uri);
|
DownloadManager.Request request = new DownloadManager.Request(uri);
|
||||||
request.allowScanningByMediaScanner();
|
request.allowScanningByMediaScanner();
|
||||||
|
|
|
@ -5,13 +5,16 @@
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:background="@android:color/black">
|
android:background="@android:color/black">
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/view_media_progress"
|
android:id="@+id/view_media_progress"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
<uk.co.senab.photoview.PhotoView
|
|
||||||
|
<com.github.chrisbanes.photoview.PhotoView
|
||||||
android:id="@+id/view_media_image"
|
android:id="@+id/view_media_image"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
Loading…
Reference in a new issue