- Information by upload fields

- Fixed conflicts
This commit is contained in:
mebr1416 2017-07-28 16:26:56 +03:00
parent 05bdfb588e
commit b32320b344
2 changed files with 25 additions and 33 deletions

View file

@ -12,7 +12,6 @@ import android.support.v4.app.Fragment;
import android.support.v7.app.AlertDialog;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
@ -25,10 +24,8 @@ import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
@ -207,16 +204,13 @@ public class SingleUploadFragment extends Fragment {
/**
* Copied from https://stackoverflow.com/a/26269435/8065933
* @param view
* @param motionEvent
* @return
*/
@OnTouch(R.id.titleEdit) boolean titleInfo(View view, MotionEvent motionEvent){
@OnTouch
(R.id.titleEdit) boolean titleInfo(View view, MotionEvent motionEvent) {
//Should replace right with end to support different right-to-left languages as well
final int value = titleEdit.getRight() - titleEdit.getCompoundDrawables()[2].getBounds().width();
final int DRAWABLE_RIGHT = 2;
if(motionEvent.getAction() == MotionEvent.ACTION_UP) {
if(motionEvent.getRawX() >= (titleEdit.getRight() - titleEdit.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width())) {
if (motionEvent.getAction() == motionEvent.ACTION_UP && motionEvent.getRawX() >= value) {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setTitle(R.string.media_detail_title);
@ -233,16 +227,14 @@ public class SingleUploadFragment extends Fragment {
alert.show();
return true;
}
}
return false;
}
@OnTouch(R.id.descEdit) boolean descriptionInfo(View view, MotionEvent motionEvent){
@OnTouch
(R.id.descEdit) boolean descriptionInfo(View view, MotionEvent motionEvent) {
final int value = descEdit.getRight() - descEdit.getCompoundDrawables()[2].getBounds().width();
final int DRAWABLE_RIGHT = 2;
if(motionEvent.getAction() == MotionEvent.ACTION_UP) {
if(motionEvent.getRawX() >= (titleEdit.getRight() - titleEdit.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width())) {
if (motionEvent.getAction() == motionEvent.ACTION_UP && motionEvent.getRawX() >= value) {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setTitle(R.string.media_detail_description);
@ -258,7 +250,7 @@ public class SingleUploadFragment extends Fragment {
AlertDialog alert = builder.create();
alert.show();
return true;
}
}
return false;
}