Java Code Examples for android.widget.ImageView#setOnDragListener()

The following examples show how to use android.widget.ImageView#setOnDragListener() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
        @Nullable Bundle savedInstanceState) {

    View rootView = inflater.inflate(R.layout.fragment_droptarget, container, false);
    final ImageView imageView = (ImageView) rootView.findViewById(R.id.image_target);

    ImageDragListener imageDragListener = new PermissionAwareImageDragListener();

    imageView.setOnDragListener(imageDragListener);

    // Restore the application state if an image was being displayed.
    if (savedInstanceState != null) {
        final String uriString = savedInstanceState.getString(IMAGE_URI);
        if (uriString != null) {
            mImageUri = Uri.parse(uriString);
            imageView.setImageURI(mImageUri);
        }
    }

    mReleasePermissionCheckBox = (CheckBox) rootView.findViewById(R.id.release_checkbox);

    return rootView;
}
 
Example 2
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
        @Nullable Bundle savedInstanceState) {

    View rootView = inflater.inflate(R.layout.fragment_droptarget, container, false);
    final ImageView imageView = (ImageView) rootView.findViewById(R.id.image_target);

    ImageDragListener imageDragListener = new PermissionAwareImageDragListener();

    imageView.setOnDragListener(imageDragListener);

    // Restore the application state if an image was being displayed.
    if (savedInstanceState != null) {
        final String uriString = savedInstanceState.getString(IMAGE_URI);
        if (uriString != null) {
            mImageUri = Uri.parse(uriString);
            imageView.setImageURI(mImageUri);
        }
    }

    mReleasePermissionCheckBox = (CheckBox) rootView.findViewById(R.id.release_checkbox);

    return rootView;
}
 
Example 3
private void init()
{
	innerFeedbackCollectionContainerElement = feedbackCollectionContainerElement;
	feedbackCollectionContainerElement = null;
	if (innerFeedbackCollectionContainerElement == null)
	{
		finish();
		throw new RuntimeException("no feedbackcontainer given");
	}
	levelLinearLayout = (LinearLayout) findViewById(R.id.feedbackLinearLayout);
	recycleBin = (ImageView) findViewById(R.id.recycleBin);
	recycleBin.setOnDragListener(new FeedbackCollectionOnDragListener(this));

	setTitle(((FeedbackCollection) innerFeedbackCollectionContainerElement.getElement()).getComponentName());
	feedbackLevelLayoutList = new ArrayList<>();

	this.feedbackListener = new FeedbackListener()
	{
		@Override
		public void onComponentAdded()
		{
			deleteEmptyLevels();
			addEmptyLevel();
		}
	};
}
 
Example 4
Source Project: BubbleActions   File: BubbleView.java    License: Apache License 2.0 5 votes vote down vote up
public BubbleView(Context context) {
    super(context);

    setOrientation(VERTICAL);
    LayoutInflater.from(context).inflate(R.layout.bubble_actions_bubble_item, this, true);
    textView = (TextView) getChildAt(0);
    imageView = (ImageView) getChildAt(1);
    imageView.setOnDragListener(dragListener);
    imageView.setScaleX(DESELECTED_SCALE);
    imageView.setScaleY(DESELECTED_SCALE);
}
 
Example 5
Source Project: Passbook   File: EditFragment.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    if(mApp == null || mApp.getAccountManager() == null) {
        return null;
    }
    View rootView = inflater.inflate(R.layout.fragment_edit, container, false);
    mContainer = rootView.findViewById(android.R.id.list);
    View footer = inflater.inflate(R.layout.add_field, container, false);
    footer.setOnClickListener(this);
    mNameEditText = rootView.findViewById(android.R.id.title);
    mScroll = rootView.findViewById(R.id.scroll);
    mNameEditText.addTextChangedListener(this);
    mToolbarContainer = rootView.findViewById(R.id.toolbar_container);
    if(mToolbarContainer!=null) {
        mHeader = rootView.findViewById(R.id.header);
        mScroll.setPbScrollListener(this);
    }
    setupToolbar(rootView);
    mCategorySpinner = rootView.findViewById(R.id.category);
    if(mAccountId >= 0) {
        mDummyAccount = mApp.getAccountManager().getAccountById(mAccountId).clone();
        mName = mDummyAccount.getAccountName();
    }
    else {
        mDummyAccount = getEntryList();
        mName = "";
    }
    int spinnerLayout = android.os.Build.VERSION.SDK_INT>=android.os.Build.VERSION_CODES.JELLY_BEAN ?
            android.R.layout.simple_spinner_dropdown_item : R.layout.spinner_dropdown;
    if (getActivity() != null) {
        mTypeAdapter = ArrayAdapter.createFromResource(getActivity(),
                R.array.field_types, android.R.layout.simple_spinner_dropdown_item);
        mTypeAdapter.setDropDownViewResource(spinnerLayout);
    }
    mEntries = new ArrayList<> ();
    mDeleteView = (ImageView)inflater.inflate(R.layout.delete_field, container, false);
    int pos = 0;
    for(Entry e : mDummyAccount.getEntryList()) {
        onAddField(e, pos++);
    }
    mContainer.addView(footer);
    mContainer.addView(mDeleteView);
    mDeleteView.setOnDragListener(mDragListener);
    ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(getActivity(),
            android.R.layout.simple_spinner_dropdown_item , mApp.getSortedCategoryNames());
    spinnerAdapter.setDropDownViewResource(spinnerLayout);
    mCategorySpinner.setAdapter(spinnerAdapter);
    mCategorySpinner.setOnItemSelectedListener(this);
    View top = rootView.findViewById(R.id.top_frame);
    if(top!=null) {
        top.setOnClickListener(this);
    }
    return rootView;
}