Android Open Source - MiniExpense Menu Methods






From Project

Back to project page MiniExpense.

License

The source code is released under:

Apache License

If you think the Android project MiniExpense listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.duplavid.miniexpense;
/*from   w ww . j  a  v  a  2s . co m*/
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.MenuItem;

public class MenuMethods{
    public static void euroBlue(Context context, Menu menu){
      SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
        SharedPreferences.Editor editor = settings.edit();
        editor.putString("currency", "euro");
        editor.commit();
        MenuItem item = menu.findItem(R.id.euro);
        item.setIcon(R.drawable.euroblue);
        MenuItem item2 = menu.findItem(R.id.dollar);
        item2.setIcon(R.drawable.dollar);
    }
    
    public static void dollarBlue(Context context, Menu menu){
      SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
        SharedPreferences.Editor editor = settings.edit();
        editor.putString("currency", "dollar");
        editor.commit();
        MenuItem item = menu.findItem(R.id.dollar);
        item.setIcon(R.drawable.dollarblue);
        MenuItem item2 = menu.findItem(R.id.euro);
        item2.setIcon(R.drawable.euro);
    }
}




Java Source Code List

com.duplavid.miniexpense.CustomAdapter.java
com.duplavid.miniexpense.DatabaseHandler.java
com.duplavid.miniexpense.ExpenseAdd.java
com.duplavid.miniexpense.ExpenseView.java
com.duplavid.miniexpense.Expense.java
com.duplavid.miniexpense.MainActivity.java
com.duplavid.miniexpense.MenuMethods.java
com.duplavid.miniexpense.SingleListItem.java