Android Open Source - Dhamaschool Utils






From Project

Back to project page Dhamaschool.

License

The source code is released under:

Apache License

If you think the Android project Dhamaschool 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 group.ripple.dhamaschool;
/* w  ww  . j ava2 s  . c o  m*/
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
import android.net.Uri;

import com.afollestad.materialdialogs.MaterialDialog;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by YMT on 12/8/2014.
 */
public class Utils {
    public static Typeface mm(Context cmx) {
        return Typeface.createFromAsset(cmx.getAssets(),"fonts/SmartZawgyiPro.ttf");
    }


    public static CharSequence DateConverterFB(String date) {
        // TODO Auto-generated method stub

        SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss+hh:mm");
        Date result_date = null;
        try {
            result_date = dt.parse(date);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        String final_date_reslut = df.format(result_date);

        return final_date_reslut;
    }

    public static void SendEmail(Context context,String email_address){



        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.setData(Uri.parse("mailto:" + email_address));
        intent.setType("text/html");
        intent.putExtra(Intent.EXTRA_SUBJECT, context.getText(R.string.app_name));
        intent.putExtra(Intent.EXTRA_EMAIL, new String[] { email_address });
        intent.setType("message/rfc822");
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }

    public static void PhoneCall(Context c, String number) {
        Intent call = new Intent(Intent.ACTION_DIAL);
        call.setData(Uri.parse("tel:" + number));
        c.startActivity(call);
    }



}




Java Source Code List

group.ripple.dhamaschool.About_Us_Fragment.java
group.ripple.dhamaschool.ApplicationTest.java
group.ripple.dhamaschool.BaseDAO.java
group.ripple.dhamaschool.Constant.java
group.ripple.dhamaschool.Contact_fragment.java
group.ripple.dhamaschool.DatabaseManager.java
group.ripple.dhamaschool.DetailActivity.java
group.ripple.dhamaschool.DetailPagerFB.java
group.ripple.dhamaschool.FacebookPage.java
group.ripple.dhamaschool.Home.java
group.ripple.dhamaschool.MainActivity.java
group.ripple.dhamaschool.NetworkListener.java
group.ripple.dhamaschool.NewsDao.java
group.ripple.dhamaschool.NewsObjAdapter.java
group.ripple.dhamaschool.NewsObj.java
group.ripple.dhamaschool.SplashActivity.java
group.ripple.dhamaschool.Utils.java
group.ripple.dhamaschool.WebViewActivity.java