Java Code Examples for com.grarak.kerneladiutor.utils.Utils#DARKTHEME

The following examples show how to use com.grarak.kerneladiutor.utils.Utils#DARKTHEME . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainActivity.java    From KA27 with Apache License 2.0 6 votes vote down vote up
/**
 * Setup the views
 */
private void setInterface() {
    if (mScrimInsetsFrameLayout != null) {
        mScrimInsetsFrameLayout.setLayoutParams(getDrawerParams());
        if (Utils.DARKTHEME)
            mScrimInsetsFrameLayout.setBackgroundColor(ContextCompat.getColor(MainActivity.this, R.color.navigationdrawer_background_dark));
    }

    setItems(null);
    if (mDrawerLayout != null) {
        mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar, 0, 0);
        mDrawerLayout.addDrawerListener(mDrawerToggle);

        mDrawerLayout.post(new Runnable() {
            @Override
            public void run() {
                if (mDrawerToggle != null) mDrawerToggle.syncState();
            }
        });
    }
}
 
Example 2
Source File: MainActivity.java    From kernel_adiutor with Apache License 2.0 6 votes vote down vote up
/**
 * Setup the views
 */
private void setInterface() {
    if (mScrimInsetsFrameLayout != null) {
        mScrimInsetsFrameLayout.setLayoutParams(getDrawerParams());
        if (Utils.DARKTHEME)
            mScrimInsetsFrameLayout.setBackgroundColor(getResources().getColor(R.color.navigationdrawer_background_dark));
    }

    setItems(null);
    if (mDrawerLayout != null) {
        mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar, 0, 0);
        mDrawerLayout.setDrawerListener(mDrawerToggle);

        mDrawerLayout.post(new Runnable() {
            @Override
            public void run() {
                if (mDrawerToggle != null) mDrawerToggle.syncState();
            }
        });
    }
}
 
Example 3
Source File: SplashView.java    From KA27 with Apache License 2.0 5 votes vote down vote up
public void finish() {
    if (Utils.DARKTHEME)
        mPaintCircle.setColor(ContextCompat.getColor(getContext(), R.color.navigationdrawer_background_dark));
    new Thread(new Runnable() {
        @Override
        public void run() {
            try {
                for (int i = 1; i <= getHeight() / 2; i += 15) {
                    radius = i;
                    ((Activity) getContext()).runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            invalidate();
                        }
                    });
                    Thread.sleep(17);
                }
                ((Activity) getContext()).runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        setVisibility(GONE);
                        finished = true;
                        startAnimation(AnimationUtils.loadAnimation(getContext(), android.R.anim.fade_out));
                    }
                });
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }).start();
}
 
Example 4
Source File: BaseActivity.java    From KA27 with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Check if darktheme is in use and cache it as boolean
    if (Utils.DARKTHEME = Utils.getBoolean("darktheme", false, this)) {
        super.setTheme(getDarkTheme());
        getWindow().getDecorView().getRootView().setBackgroundColor(ContextCompat.getColor(this, R.color.black));
    }

    if (getParentViewId() != 0) setContentView(getParentViewId());
    else if (getParentView() != null) setContentView(getParentView());

    Toolbar toolbar;
    if ((toolbar = getToolbar()) != null) {
        if (Utils.DARKTHEME) toolbar.setPopupTheme(R.style.ThemeOverlay_AppCompat_Dark);
        try {
            setSupportActionBar(toolbar);
        } catch (NoClassDefFoundError e) {
            Utils.toast(e.getMessage(), this, Toast.LENGTH_LONG);
            finish();
        }
    }

    ActionBar actionBar;
    if ((actionBar = getSupportActionBar()) != null)
        actionBar.setDisplayHomeAsUpEnabled(getDisplayHomeAsUpEnabled());

    setStatusBarColor();
}
 
Example 5
Source File: DAdapter.java    From kernel_adiutor with Apache License 2.0 5 votes vote down vote up
@Override
public void onBindViewHolder(RecyclerView.ViewHolder viewHolder) {
    ((TextView) viewHolder.itemView.findViewById(R.id.text)).setText(title.toUpperCase());
    if (Utils.DARKTHEME)
        viewHolder.itemView.findViewById(R.id.divider_view).setBackgroundColor(viewHolder.itemView.getResources()
                .getColor(R.color.divider_background_dark));
}
 
Example 6
Source File: DownloadInfoCardView.java    From kernel_adiutor with Apache License 2.0 5 votes vote down vote up
@Override
public void setUpInnerLayout(View view) {
    linksLayout = view.findViewById(R.id.links_layout);
    xdaButton = (ImageButton) view.findViewById(R.id.xda_button);
    githubButton = (ImageButton) view.findViewById(R.id.github_button);
    googlePlusButton = (ImageButton) view.findViewById(R.id.googleplus_button);
    paypalButton = (ImageButton) view.findViewById(R.id.paypal_button);

    shortDescription = (TextView) view.findViewById(R.id.short_description);
    longDescription = (TextView) view.findViewById(R.id.long_description);

    if (Utils.DARKTHEME)
        view.findViewById(R.id.links_divider).setBackgroundColor(getResources().getColor(R.color.divider_background_dark));
}
 
Example 7
Source File: SplashView.java    From kernel_adiutor with Apache License 2.0 5 votes vote down vote up
public void finish() {
    if (Utils.DARKTHEME)
        mPaintCircle.setColor(getResources().getColor(R.color.navigationdrawer_background_dark));
    new Thread(new Runnable() {
        @Override
        public void run() {
            try {
                for (int i = 1; i <= getHeight() / 2; i += 15) {
                    radius = i;
                    ((Activity) getContext()).runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            invalidate();
                        }
                    });
                    Thread.sleep(17);
                }
                ((Activity) getContext()).runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        setVisibility(GONE);
                        finished = true;
                        startAnimation(AnimationUtils.loadAnimation(getContext(), android.R.anim.fade_out));
                    }
                });
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }).start();
}
 
Example 8
Source File: BaseActivity.java    From kernel_adiutor with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Set english as default language if option is enabled
    if (Utils.getBoolean("forceenglish", false, this)) Utils.setLocale("en_US", this);

    // Check if darktheme is in use and cache it as boolean
    if (Utils.DARKTHEME = Utils.getBoolean("darktheme", false, this)) {
        super.setTheme(getDarkTheme());
        getWindow().getDecorView().getRootView().setBackgroundColor(getResources().getColor(R.color.black));
    }

    if (getParentViewId() != 0) setContentView(getParentViewId());
    else if (getParentView() != null) setContentView(getParentView());

    Toolbar toolbar;
    if ((toolbar = getToolbar()) != null) {
        if (Utils.DARKTHEME) toolbar.setPopupTheme(R.style.ThemeOverlay_AppCompat_Dark);
        try {
            setSupportActionBar(toolbar);
        } catch (NoClassDefFoundError e) {
            Utils.toast(e.getMessage(), this, Toast.LENGTH_LONG);
            finish();
        }
    }

    ActionBar actionBar;
    if ((actionBar = getSupportActionBar()) != null)
        actionBar.setDisplayHomeAsUpEnabled(getDisplayHomeAsUpEnabled());

    setStatusBarColor();
}
 
Example 9
Source File: DAdapter.java    From KA27 with Apache License 2.0 4 votes vote down vote up
@Override
public void onBindViewHolder(RecyclerView.ViewHolder viewHolder) {
    ((TextView) viewHolder.itemView.findViewById(R.id.text)).setText(title.toUpperCase(Locale.US));
    if (Utils.DARKTHEME)
        viewHolder.itemView.findViewById(R.id.divider_view).setBackgroundColor(ContextCompat.getColor(viewHolder.itemView.getContext(), R.color.divider_background_dark));
}