Search in sources :

Example 1 with Themable

use of com.simplecity.amp_library.ui.views.Themable in project Shuttle by timusus.

the class ThemeUtils method updateThemableViews.

/**
     * Traverses the hierarchy of this view (if it's a ViewGroup). If the view itself or any of its children
     * implement {@link Themable}, calls {@link Themable#updateTheme()}
     */
public static void updateThemableViews(View view) {
    if (view instanceof ViewGroup) {
        for (int i = 0, count = ((ViewGroup) view).getChildCount(); i < count; i++) {
            View child = ((ViewGroup) view).getChildAt(i);
            updateThemableViews(child);
        }
    } else {
        if (view instanceof Themable) {
            ((Themable) view).updateTheme();
        }
    }
}
Also used : ViewGroup(android.view.ViewGroup) Themable(com.simplecity.amp_library.ui.views.Themable) SearchView(android.support.v7.widget.SearchView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) HmsView(com.doomonafireball.betterpickers.hmspicker.HmsView) AbsListView(android.widget.AbsListView) RecyclerView(android.support.v7.widget.RecyclerView) ScrollView(android.widget.ScrollView) SuppressLint(android.annotation.SuppressLint)

Aggregations

SuppressLint (android.annotation.SuppressLint)1 RecyclerView (android.support.v7.widget.RecyclerView)1 SearchView (android.support.v7.widget.SearchView)1 View (android.view.View)1 ViewGroup (android.view.ViewGroup)1 AbsListView (android.widget.AbsListView)1 ImageView (android.widget.ImageView)1 ScrollView (android.widget.ScrollView)1 TextView (android.widget.TextView)1 HmsView (com.doomonafireball.betterpickers.hmspicker.HmsView)1 Themable (com.simplecity.amp_library.ui.views.Themable)1