// Path: app/src/main/java/dynoapps/exchange_rates/App.java
// public class App extends Application {
//     private static App appInstance;
// 
//     public static App getInstance() {
//         return appInstance;
//     }
// 
//     @NonNull
//     public static Context context() {
//         return appInstance.getApplicationContext();
//     }
// 
//     public AlarmsRepository provideAlarmsRepository() {
//         return AlarmsRepository.getInstance(getApplicationContext());
//     }
// 
//     @SuppressLint("CheckResult")
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         appInstance = this;
// 
//         RxJavaPlugins.setErrorHandler(throwable -> L.e("App", throwable.getLocalizedMessage()));
//     }
// 
//     /**
//      * Enum used to identify the tracker that needs to be used for tracking.
//      * <p/>
//      * A single tracker is usually enough for most purposes. In case you do need multiple trackers,
//      * storing them all in Application object helps ensure that they are created only once per
//      * application instance.
//      */
//     public enum TrackerName {
//         APP_TRACKER, // Tracker used only in this app.
//         GLOBAL_TRACKER, // Tracker used by all the apps from a company. eg: roll-up tracking.
//     }
// 
// 
// }


import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.util.TypedValue;
import android.view.View;
import dynoapps.exchange_rates.App;
import dynoapps.exchange_rates.R;
package dynoapps.exchange_rates.util;




/**
 * Created by eolkun on 6.2.2015.
 */
public class ViewUtils {

    private static final int[] RES_IDS_ACTION_BAR_SIZE = {R.attr.actionBarSize};

    public static void visibility(View v, boolean isVisible) {
        if (v == null) return;
        v.setVisibility(isVisible ? View.VISIBLE : View.GONE);
    }

    private static int dpToPx(float dp, Resources res) {
        return (int) TypedValue.applyDimension(
                TypedValue.COMPLEX_UNIT_DIP,
                dp,
                res.getDisplayMetrics());
    }

    /**
     * This method converts dp unit to equivalent pixels, depending on device density.
     *
     * @param dp A value in dp (density independent pixels) unit. Which we need to convert into
     *           pixels
     * @return A float value to represent px equivalent to dp depending on device density
     */
    public static int dpToPx(float dp) {
// Path: app/src/main/java/dynoapps/exchange_rates/App.java
// public class App extends Application {
//     private static App appInstance;
// 
//     public static App getInstance() {
//         return appInstance;
//     }
// 
//     @NonNull
//     public static Context context() {
//         return appInstance.getApplicationContext();
//     }
// 
//     public AlarmsRepository provideAlarmsRepository() {
//         return AlarmsRepository.getInstance(getApplicationContext());
//     }
// 
//     @SuppressLint("CheckResult")
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         appInstance = this;
// 
//         RxJavaPlugins.setErrorHandler(throwable -> L.e("App", throwable.getLocalizedMessage()));
//     }
// 
//     /**
//      * Enum used to identify the tracker that needs to be used for tracking.
//      * <p/>
//      * A single tracker is usually enough for most purposes. In case you do need multiple trackers,
//      * storing them all in Application object helps ensure that they are created only once per
//      * application instance.
//      */
//     public enum TrackerName {
//         APP_TRACKER, // Tracker used only in this app.
//         GLOBAL_TRACKER, // Tracker used by all the apps from a company. eg: roll-up tracking.
//     }
// 
// 
// }


// Path: app/src/main/java/dynoapps/exchange_rates/util/ViewUtils.java
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.util.TypedValue;
import android.view.View;
import dynoapps.exchange_rates.App;
import dynoapps.exchange_rates.R;

package dynoapps.exchange_rates.util;




/**
 * Created by eolkun on 6.2.2015.
 */
public class ViewUtils {

    private static final int[] RES_IDS_ACTION_BAR_SIZE = {R.attr.actionBarSize};

    public static void visibility(View v, boolean isVisible) {
        if (v == null) return;
        v.setVisibility(isVisible ? View.VISIBLE : View.GONE);
    }

    private static int dpToPx(float dp, Resources res) {
        return (int) TypedValue.applyDimension(
                TypedValue.COMPLEX_UNIT_DIP,
                dp,
                res.getDisplayMetrics());
    }

    /**
     * This method converts dp unit to equivalent pixels, depending on device density.
     *
     * @param dp A value in dp (density independent pixels) unit. Which we need to convert into
     *           pixels
     * @return A float value to represent px equivalent to dp depending on device density
     */
    public static int dpToPx(float dp) {
        Context context = App.context();