Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to implemention PhotoEditor? #100

Closed
kkm opened this issue Nov 7, 2018 · 9 comments
Closed

How to implemention PhotoEditor? #100

kkm opened this issue Nov 7, 2018 · 9 comments
Labels
question Further information is requested

Comments

@kkm
Copy link

kkm commented Nov 7, 2018

Image of Yaktocat

I have some difficulty understanding, why does not show me anything? What have I missed?

I add gradle
implementation 'ja.burhanrashid52:photoeditor:0.3.3'

layout.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
tools:context=".MainActivity">

<ja.burhanrashid52.photoeditor.PhotoEditorView
    android:id="@+id/photoEditorView"
    android:layout_width="wrap_content"
    android:layout_height="384dp"
    app:photo_src="@drawable/ic_stat_name" />

</android.support.constraint.ConstraintLayout>

MainActivity.java:

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        PhotoEditorView mPhotoEditorView = findViewById(R.id.photoEditorView);
        mPhotoEditorView.getSource().setImageResource(R.drawable.ic_stat_name);

        Typeface mTextRobotoTf = ResourcesCompat.getFont(this, R.font.roboto_medium);
        Typeface mEmojiTypeFace = Typeface.createFromAsset(getAssets(), "fonts/emojione-android.ttf");
        PhotoEditor mPhotoEditor = new PhotoEditor.Builder(this, mPhotoEditorView)
                .setPinchTextScalable(true)
                .setDefaultTextTypeface(mTextRobotoTf)
                .setDefaultEmojiTypeface(mEmojiTypeFace)
                .build();
    }
@kkm kkm changed the title Photoeditor with controller? Photoeditor with drawing button? Nov 7, 2018
@kkm kkm changed the title Photoeditor with drawing button? How to implemention PhotoEditor? Nov 7, 2018
@kateile
Copy link

kateile commented Nov 11, 2018

Same problem here..

@burhanrashid52
Copy link
Owner

burhanrashid52 commented Nov 11, 2018

Found the problem. You have not inserted rvConstraintTools in your XML. This

@kateile
Copy link

kateile commented Nov 11, 2018

I have not figured out how to make it work till now. Lets assume I want similar Layout of the editor like the one with Ned Stark. So how my xml need to look like? Like this or this.
Is there any sample app?

@burhanrashid52
Copy link
Owner

burhanrashid52 commented Nov 11, 2018

The library already has the sample app. Check out EditImageActivity.
If you want to achieve the same layout as the Ned stark one use this.

@kkm
Copy link
Author

kkm commented Nov 13, 2018

Do I have to do everything XML or just one by one?

@burhanrashid52 burhanrashid52 added the question Further information is requested label Nov 13, 2018
@burhanrashid52
Copy link
Owner

one by one means ?

@kkm
Copy link
Author

kkm commented Nov 14, 2018

<android.support.v7.widget.RecyclerView

I mean, should I copy this row from 81 - 93 or all XML?

@burhanrashid52
Copy link
Owner

Yes, Its a list of tools which we have defined in the sample app. You can customize as per your need.

@shivadjango
Copy link

even after copying the xml recylerview could not use the tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants