This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Copyright (C) 2014 Jared Rummler <[email protected]> | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.sample.myutilities.activities; | |
| /** | |
| * @author Devrath | |
| */ | |
| import android.content.BroadcastReceiver; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.content.IntentFilter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Yes with reflection. This works ([based on this answer](http://stackoverflow.com/a/16275257/360211)): | |
| import java.lang.reflect.Field; | |
| import android.content.Context; | |
| import android.graphics.Typeface; | |
| public final class FontsOverride { | |
| public static void setDefaultFont(Context context, | |
| String staticTypefaceFieldName, String fontAssetName) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // IN THE LISTVIEW CLICK of Activity-1 USE | |
| lstViewId.setOnItemClickListener(new AdapterView.OnItemClickListener() { | |
| @Override | |
| public void onItemClick(AdapterView<?> arg0, View view, int position, long arg3) { | |
| TextView titleName=(TextView) view.findViewById(R.id.txtTitleId); | |
| //Start a new activity by putting a parcellable data into the intent | |
| Intent intent=new Intent(getActivity().getApplicationContext(), Activity2.class); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NumberFormat nf = NumberFormat.getCurrencyInstance(new Locale("en", "in")); | |
| vHolder.txtOrderValueId.setText(nf.format(mMyOrders.get(position).getOrdervalue()) + ""); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package trikke.gists; | |
| import android.graphics.Typeface; | |
| import android.text.Spannable; | |
| import android.text.SpannableString; | |
| import android.text.style.BackgroundColorSpan; | |
| import android.text.style.ForegroundColorSpan; | |
| import android.text.style.RelativeSizeSpan; | |
| import android.text.style.StrikethroughSpan; | |
| import android.text.style.StyleSpan; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <!-- RED --> | |
| <color name="red_50">#FFEBEE</color> | |
| <color name="red_100">#FFCDD2</color> | |
| <color name="red_200">#EF9A9A</color> | |
| <color name="red_300">#E57373</color> | |
| <color name="red_400">#EF5350</color> | |
| <color name="red_500">#F44336</color> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ScreenUtility { | |
| private Activity activity; | |
| private float dpWidth; | |
| private float dpHeight; | |
| public ScreenUtility(Activity activity) { | |
| this.activity = activity; | |
| Display display = activity.getWindowManager().getDefaultDisplay(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.android.test.activity; | |
| import android.os.Bundle; | |
| import android.support.v7.widget.Toolbar; | |
| import com.android.test.R; | |
| import com.android.test.fragment.MainFragment; | |
| import roboguice.RoboGuice; | |
| import roboguice.inject.InjectView; |