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

Example of custom view #37

Open
pellyadolfo opened this issue Aug 31, 2015 · 0 comments
Open

Example of custom view #37

pellyadolfo opened this issue Aug 31, 2015 · 0 comments

Comments

@pellyadolfo
Copy link

As I have not seen any example of positioning the messages in a custom view, I want to share how I solved the problem to get inputs from other users. I am not sure if this is the proper way but it works for me.... more or less:

I added this code to the layout embedded in a RelativeLayout:

                      <!-- required by AppMsg to position in another place -->
                      <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                          android:id="@+id/messagescontainer"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_centerInParent="true">

                          <include layout="@layout/app_msg"/>

                      </LinearLayout>

and this code into the Java

            LinearLayout messagesContainer = (LinearLayout) findViewById(R.id.messagesContainer);

            AppMsg.makeText(OfferActivity.this, "Error Performing this Operation", AppMsg.STYLE_ALERT, carouselContainer).show();

However, there seems to be a bug because the message is shown as soon is instantiated in makeText(), without the need to call show() method. However, you need to call show() in order to make cancel() method work. Otherwise, cancel() does not remove the message.

Are these bugs or I am not using it in the proper way?

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

No branches or pull requests

1 participant