hotchemi / Android-Rate

Android-Rate is a library to help you promote your android app by prompting users to rate the app after using it for a few days.
http://hotchemi.github.io/Android-Rate
MIT License
720 stars 216 forks source link

dialog window custom color and buttons colors #130

Open robertelo opened 7 years ago

robertelo commented 7 years ago

Hello, I tried adding this in main_activity ` .setTitle(R.string.new_rate_dialog_title) .setTextLater(R.string.new_rate_dialog_later) .setTextNever(R.string.new_rate_dialog_never) .setTextRateNow(R.string.new_rate_dialog_ok) .monitor();

    LayoutInflater inflater = (LayoutInflater)this.getSystemService(LAYOUT_INFLATER_SERVICE);
    View view = inflater.inflate(R.layout.custom_dialog, (ViewGroup)findViewById(R.id.ratedialog));
    AppRate.with(this).setView(view).monitor();
    AppRate.showRateDialogIfMeetsConditions(this);`

and this in custom_dialog.xml `<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minWidth="280dp" android:orientation="vertical" android:padding="10dp" android:id="@+id/ratedialog" android:layout_gravity="center">

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/dialog_bg2"
    android:padding="0dp" >

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="Rate Us!"
        android:layout_margin="5dp"
        android:ellipsize="end"
        android:gravity="center"
        android:maxLines="1"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="@android:color/black" />

</LinearLayout>

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_marginTop="-2dp"
    android:background="@drawable/dialog_bg2"
    android:padding="0dp" >

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="vertical">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="10dp"
            android:text="text text text ?" />

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" >

            <Button
                android:layout_width="wrap_content"
                android:layout_height="50dp"
                android:layout_marginRight="10dp"
                android:background="@drawable/dialog_bg2"
                android:minWidth="100dp"
                android:text="@string/new_rate_dialog_later" />

            <Button
                android:layout_width="wrap_content"
                android:layout_height="50dp"
                android:layout_marginLeft="10dp"
                android:background="@drawable/dialog_bg2"
                android:minWidth="100dp"
                android:text="@string/rate_dialog_ok" />

        </LinearLayout>

    </LinearLayout>

</LinearLayout>

`

But it's not working, i can't see the new layout overlapping the apprater dialog. Please help

BrandonZV19 commented 6 years ago

Did you solve it?

robertelo commented 6 years ago

Did you solve it? Unfortunately no

AlexanderLS commented 6 years ago

Hi @robertelo , @BrandonZV19

Try to use https://github.com/Vorlonsoft/AndroidRate It should work...

navczydev commented 5 years ago

@AlexanderLS what would be the id for ViewGroup in view inflation.? Is this is id of the parent tag of custom layout? View view = inflater.inflate(R.layout.custom_dialog, (ViewGroup)findViewById(R.id.ratedialog)); Thanks

ataravati commented 5 years ago

Did anyone manage to resolve this?