安卓定制的Zendesk率我的应用程序UI [英] Android : Customize Zendesk Rate My APP UI

查看:264
本文介绍了安卓定制的Zendesk率我的应用程序UI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何自定义我的速度中的Zendesk应用程序对话。在示例应用程序的样式在style.xml文件添加,这是工作。但我不知道如何应用样式评级对话框。请帮帮我。先谢谢了。

style.xml:

 <! -  +++++++++++++++++++++++++++++++++ - >
    <! - 开工率我的应用程序对话风格 - >
    &所述;! - +++++++++++++++++++++++++++++++++ - >    <样式名称=rma_button>
        <项目名称=机器人:背景> @彩色/ light_background< /项目>
        <项目名称=安卓重力>中心< /项目>
        <项目名称=机器人:TEXTSIZE> 18sp< /项目>
        <项目名称=机器人:layout_weight> 1 LT; /项目>
        <项目名称=机器人:lineSpacingMultiplier> 1.25 LT; /项目>
    < /风格>    <样式名称=rma_title父=rma_button>
        <项目名称=机器人:TEXTSIZE> 22sp< /项目>
        <项目名称=机器人:背景> @android:彩色/白色< /项目>
        <项目名称=机器人:lineSpacingMultiplier> 1.25 LT; /项目>
    < /风格>    <样式名称=rma_divider>
        <项目名称=机器人:layout_width> match_parent< /项目>
        <项目名称=机器人:layout_height> 1px的< /项目>
        <项目名称=机器人:背景> @色/除法< /项目>
    < /风格>    &所述;! - +++++++++++++++++++++++++++++++ - >
    <! - 结束速度我的应用程序对话风格 - >
    &所述;! - +++++++++++++++++++++++++++++++ - >    &所述;! - ++++++++++++++++++++++++++++++++++++++++++ - &GT ;
    <! - 开工率我的应用程序对话反馈风格 - >
    &所述;! - ++++++++++++++++++++++++++++++++++++++++++ - &GT ;    <样式名称=rma_feedback_issue_cancel_button父=_ rma_feedback_issue_cancel_button>
        <项目名称=机器人:背景> @绘制/ white_gradient_btn< /项目>
        <项目名称=机器人:文字颜色> @彩色/ grey_text< /项目>
    < /风格>    <! -
        这种风格将覆盖父样式更改按钮的背景颜色
        根据国家
     - >
    <样式名称=rma_feedback_issue_send_button父=_ rma_feedback_issue_send_button>
        <项目名称=机器人:layout_marginLeft>&8DP LT; /项目>
        <项目名称=机器人:背景> @绘制/ green_gray_btn_selector< /项目> <! - 按键颜色会发生变化 - >
        <项目名称=机器人:文字颜色> @彩色/ green_gray_txt_selector< /项目>
    < /风格>    <样式名称=rma_feedback_message_title父=_ rma_feedback_message_title>
        <项目名称=机器人:文字颜色> @彩色/ grey_text< /项目>
    < /风格>    <样式名称=rma_feedback_message_subtitle父=_ rma_feedback_message_subtitle>
        <项目名称=机器人:文字颜色> @彩色/ grey_text< /项目>
        <项目名称=机器人:lineSpacingMultiplier> 1.25 LT; /项目>
    < /风格>    <! -
        在这个例子中,我们使用的是选择控制颜色覆盖父样式
        的不同的EditText是否启用或禁用的文本。
     - >
    <样式名称=rma_feedback_issue_edittext父=_ rma_feedback_issue_edittext>
        <项目名称=机器人:文字颜色> @彩色/ enabled_disabled_grey_selector< /项目>
        <项目名称=机器人:textColorHint> @彩色/ text_hint< /项目>
    < /风格>
    <样式名称=rma_feedback_divider父=_ rma_feedback_divider>
        <项目名称=机器人:背景> @色/除法< /项目>
    < /风格>
    <样式名称=rma_feedback_progress父=_ rma_feedback_progress>
        <项目名称=机器人:indeterminateDrawable> @绘制/ progress_green_small_holo< /项目>
    < /风格>    &所述;! - ++++++++++++++++++++++++++++++++++++++++ - >
    <! - 结束速度我的应用程序对话反馈风格 - >
    &所述;! - ++++++++++++++++++++++++++++++++++++++++ - >


解决方案

问题通过创建一个使用RateMyApp对话框,并申请按钮,标题和对话的方式分如下

活性的单独的主题解析

 <样式名称=CustomTheme父=Theme.AppCompat>        <项目名称=RateMyAppPaddingTop> @扪/ rma_padding_top< /项目>
        <项目名称=RateMyAppPaddingBottom> @扪/ rma_padding_bottom< /项目>
        <项目名称=RateMyAppButtonStyle> @风格/ rma_button_style< /项目>
        <项目名称=RateMyAppTitleStyle> @风格/ rma_title_style< /项目>        <项目名称=RateMyAppDividerStyle> @风格/ rma_divider_style< /项目>
        <项目名称=RateMyAppDividerHeight> @扪/ rma_divider_height< /项目>
    < /风格>
<扪NAME =rma_padding_top> 24dp< /扪>
    <扪NAME =rma_padding_bottom> 24dp< /扪><样式名称=rma_button_style>
        <项目名称=机器人:背景> @彩色/ light_background< /项目>
        <项目名称=安卓重力>中心< /项目>
        <项目名称=机器人:TEXTSIZE> 18sp< /项目>
        <项目名称=机器人:layout_weight> 1 LT; /项目>
        <项目名称=机器人:文字颜色> @彩色/黑白LT; /项目>
        <项目名称=机器人:lineSpacingMultiplier> 1.25 LT; /项目>
    < /风格>
    <样式名称=rma_divider_style>
        <项目名称=机器人:layout_width> match_parent< /项目>
        <项目名称=机器人:layout_height> 1px的< /项目>
        <项目名称=机器人:背景> @色/除法< /项目>
    < /风格>
    <样式名称=rma_title_style父=rma_button>
        <项目名称=机器人:TEXTSIZE> 22sp< /项目>
        <项目名称=机器人:背景> @android:彩色/白色< /项目>
        <项目名称=机器人:lineSpacingMultiplier> 1.25 LT; /项目>
        <项目名称=机器人:文字颜色> @彩色/黑白LT; /项目>
    < /风格>

How can I customize rate my app dialog of Zendesk. In sample app a style is added in style.xml file and it is working. But I don't know how to apply that style for Rating dialog. Please help me. Thanks in advance.

style.xml:

    <!-- +++++++++++++++++++++++++++++++++ -->
    <!-- Start rate my app dialogue styles -->
    <!-- +++++++++++++++++++++++++++++++++ -->

    <style name="rma_button">
        <item name="android:background">@color/light_background</item>
        <item name="android:gravity">center</item>
        <item name="android:textSize">18sp</item>
        <item name="android:layout_weight">1</item>
        <item name="android:lineSpacingMultiplier">1.25</item>
    </style>

    <style name="rma_title" parent="rma_button">
        <item name="android:textSize">22sp</item>
        <item name="android:background">@android:color/white</item>
        <item name="android:lineSpacingMultiplier">1.25</item>
    </style>

    <style name="rma_divider">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">1px</item>
        <item name="android:background">@color/divider</item>
    </style>

    <!-- +++++++++++++++++++++++++++++++ -->
    <!-- End rate my app dialogue styles -->
    <!-- +++++++++++++++++++++++++++++++ -->

    <!-- ++++++++++++++++++++++++++++++++++++++++++ -->
    <!-- Start rate my app dialogue feedback styles -->
    <!-- ++++++++++++++++++++++++++++++++++++++++++ -->

    <style name="rma_feedback_issue_cancel_button" parent="_rma_feedback_issue_cancel_button">
        <item name="android:background">@drawable/white_gradient_btn</item>
        <item name="android:textColor">@color/grey_text</item>
    </style>

    <!--
        This style overrides the parent style to change the background colour of the button
        depending on the state
    -->
    <style name="rma_feedback_issue_send_button" parent="_rma_feedback_issue_send_button">
        <item name="android:layout_marginLeft">8dp</item>
        <item name="android:background">@drawable/green_gray_btn_selector</item> <!-- Button colour will change  -->
        <item name="android:textColor">@color/green_gray_txt_selector</item>
    </style>

    <style name="rma_feedback_message_title" parent="_rma_feedback_message_title">
        <item name="android:textColor">@color/grey_text</item>
    </style>

    <style name="rma_feedback_message_subtitle" parent="_rma_feedback_message_subtitle">
        <item name="android:textColor">@color/grey_text</item>
        <item name="android:lineSpacingMultiplier">1.25</item>
    </style>

    <!--
        In this example we are overriding the parent style using a selector to control the colour
        of the text differently whether the edittext is enabled or disabled.
    -->
    <style name="rma_feedback_issue_edittext" parent="_rma_feedback_issue_edittext">
        <item name="android:textColor">@color/enabled_disabled_grey_selector</item>
        <item name="android:textColorHint">@color/text_hint</item>
    </style>


    <style name="rma_feedback_divider" parent="_rma_feedback_divider">
        <item name="android:background">@color/divider</item>
    </style>


    <style name="rma_feedback_progress" parent="_rma_feedback_progress">
        <item name="android:indeterminateDrawable">@drawable/progress_green_small_holo</item>
    </style>

    <!-- ++++++++++++++++++++++++++++++++++++++++ -->
    <!-- End rate my app dialogue feedback styles -->
    <!-- ++++++++++++++++++++++++++++++++++++++++ -->

解决方案

Issue resolved by creating a separate theme for the activity that is using RateMyApp dialog and applied styles for button, title and divider of dialog as below

 <style name="CustomTheme" parent="Theme.AppCompat">

        <item name="RateMyAppPaddingTop">@dimen/rma_padding_top</item>
        <item name="RateMyAppPaddingBottom">@dimen/rma_padding_bottom</item>
        <item name="RateMyAppButtonStyle">@style/rma_button_style</item>
        <item name="RateMyAppTitleStyle">@style/rma_title_style</item>

        <item name="RateMyAppDividerStyle">@style/rma_divider_style</item>
        <item name="RateMyAppDividerHeight">@dimen/rma_divider_height</item>
    </style>


<dimen name="rma_padding_top">24dp</dimen>
    <dimen name="rma_padding_bottom">24dp</dimen>

<style name="rma_button_style">
        <item name="android:background">@color/light_background</item>
        <item name="android:gravity">center</item>
        <item name="android:textSize">18sp</item>
        <item name="android:layout_weight">1</item>
        <item name="android:textColor">@color/black</item>
        <item name="android:lineSpacingMultiplier">1.25</item>
    </style>
    <style name="rma_divider_style">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">1px</item>
        <item name="android:background">@color/divider</item>
    </style>
    <style name="rma_title_style" parent="rma_button">
        <item name="android:textSize">22sp</item>
        <item name="android:background">@android:color/white</item>
        <item name="android:lineSpacingMultiplier">1.25</item>
        <item name="android:textColor">@color/black</item>
    </style>

这篇关于安卓定制的Zendesk率我的应用程序UI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆