Example usage for android.graphics Typeface NORMAL

List of usage examples for android.graphics Typeface NORMAL

Introduction

In this page you can find the example usage for android.graphics Typeface NORMAL.

Prototype

int NORMAL

To view the source code for android.graphics Typeface NORMAL.

Click Source Link

Usage

From source file:org.cyanogenmod.theme.chooser.FontPreviewFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mPkgName = getArguments().getString(PKG_EXTRA);

    ThemedTypefaceHelper helper = new ThemedTypefaceHelper();
    helper.load(getActivity(), mPkgName);
    mTypefaceNormal = helper.getTypeface(Typeface.NORMAL);
    mTypefaceBold = helper.getTypeface(Typeface.BOLD);
    mTypefaceItalic = helper.getTypeface(Typeface.ITALIC);
    mTypefaceBoldItalic = helper.getTypeface(Typeface.BOLD_ITALIC);
}

From source file:app.philm.in.util.TypefaceManager.java

public Typeface getRobotoLight() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        return Typeface.create(ROBOTO_LIGHT_NATIVE_FONT_FAMILY, Typeface.NORMAL);
    }// w  ww  . j a va  2  s.  c  o  m
    return getTypeface(ROBOTO_LIGHT_FILENAME);
}

From source file:com.ryan.demostore.logger.LogFragment.java

public View inflateViews() {
    mScrollView = new ScrollView(getActivity());
    ViewGroup.LayoutParams scrollParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT);
    mScrollView.setLayoutParams(scrollParams);

    mLogView = new LogView(getActivity());
    ViewGroup.LayoutParams logParams = new ViewGroup.LayoutParams(scrollParams);
    logParams.height = ViewGroup.LayoutParams.WRAP_CONTENT;
    mLogView.setTextAppearance(android.R.style.TextAppearance_Material_Medium);
    mLogView.setLayoutParams(logParams);
    mLogView.setClickable(true);//from ww  w .  j ava  2 s  .com
    mLogView.setFocusable(true);
    mLogView.setTypeface(Typeface.create("monospace", Typeface.NORMAL));

    // Want to set padding as 16 dips, setPadding takes pixels.  Hooray math!
    int paddingDips = 16;
    double scale = getResources().getDisplayMetrics().density;
    int paddingPixels = (int) ((paddingDips * (scale)) + .5);
    mLogView.setPadding(paddingPixels, paddingPixels, paddingPixels, paddingPixels);
    mLogView.setCompoundDrawablePadding(paddingPixels);

    mLogView.setGravity(Gravity.BOTTOM);

    mScrollView.addView(mLogView);
    return mScrollView;
}

From source file:app.philm.in.util.TypefaceManager.java

public Typeface getRobotoCondensed() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        return Typeface.create(ROBOTO_CONDENSED_NATIVE_FONT_FAMILY, Typeface.NORMAL);
    }/*from w  w w .j av  a2  s .  c  om*/
    return getTypeface(ROBOTO_CONDENSED_FILENAME);
}

From source file:app.hacked.ChallengeDetailsFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.challenge_details, null);

    ((TextView) view.findViewById(R.id.Title)).setTypeface(Typeface.create("sans-serif-thin", Typeface.NORMAL));
    ((TextView) view.findViewById(R.id.Title)).setText(Html.fromHtml(ChallengeTitle));

    ((TextView) view.findViewById(R.id.challengeDetails)).setText(Html.fromHtml(ChallengeDetails));
    return view;//from  w w w. jav a  2 s.  c o  m
}

From source file:yalantis.ua.econtactapp.customviews.CustomTabLayout.java

@Override
public void setTabsFromPagerAdapter(@NonNull PagerAdapter adapter) {
    this.removeAllTabs();
    ViewGroup slidingTabStrip = (ViewGroup) getChildAt(0);
    for (int i = 0, count = adapter.getCount(); i < count; i++) {
        Tab tab = this.newTab();
        this.addTab(tab.setText(adapter.getPageTitle(i)));
        AppCompatTextView view = (AppCompatTextView) ((ViewGroup) slidingTabStrip.getChildAt(i)).getChildAt(1);
        view.setTypeface(FontInitializer.ROBOTO_MEDIUM, Typeface.NORMAL);
    }// w w w  . j  a  v a2s . c  om
}

From source file:org.xbmc.android.app.ui.MoviesActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ButterKnife.inject(this);
    Injector.inject(this);

    pager.setAdapter(new MovieSliderAdapter(getSupportFragmentManager()));
    tabs.setViewPager(pager);//from   w ww. j  ava 2s . co  m
    tabs.setTypeface(RobotoTypefaceManager.obtaintTypeface(getApplicationContext(), 8), Typeface.NORMAL); // 8 = bold.

}

From source file:com.allmycode.flags.other.MyActivityOther.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);/*  w  w w .  j a va 2 s  . c  o  m*/
    targetActivity = (EditText) findViewById(R.id.editText1);
    flags = (EditText) findViewById(R.id.editText2);
    cheatSheet = (EditText) findViewById(R.id.editText3);
    for (String item : flagsList) {
        cheatSheet.append(item);
        cheatSheet.append("\n");
    }
    Intent whoCalled = getIntent();
    helloView = ((TextView) findViewById(R.id.textView3));
    helloView.setTextColor(android.graphics.Color.WHITE);
    helloView.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);
    helloView.setText("Flags: 0x" + Integer.toHexString(whoCalled.getFlags()));
    if (whoCalled.getExtras() != null) {
        boolean areErrors = whoCalled.getExtras().getBoolean("existErrors", false);
        if (areErrors) {
            helloView.append(" There were errors!");
            helloView.setTextColor(android.graphics.Color.RED);
            helloView.setTypeface(Typeface.DEFAULT, Typeface.BOLD);
        }
    }
    ActivityManager am = (ActivityManager) getSystemService(Service.ACTIVITY_SERVICE);
    List<ActivityManager.RunningAppProcessInfo> processes;
    processes = am.getRunningAppProcesses();
    for (ActivityManager.RunningAppProcessInfo info : processes) {
        Log.i("Process:", info.processName);
    }
}

From source file:app.hacked.AddProjectFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.add_project_fragment, null);

    ((TextView) view.findViewById(R.id.Title)).setTypeface(Typeface.create("sans-serif-thin", Typeface.NORMAL));

    ProjectNameET = (EditText) view.findViewById(R.id.ProjectNameET);
    SynopsisET = (EditText) view.findViewById(R.id.SynopsisET);
    DescET = (EditText) view.findViewById(R.id.DescET);
    TeamMemberET = (EditText) view.findViewById(R.id.TeamMemberET);
    TechET = (EditText) view.findViewById(R.id.ProjectNameET);

    ((Button) view.findViewById(R.id.CancelButton)).setOnClickListener(new View.OnClickListener() {
        @Override/*from w w w. ja v  a  2  s . c o m*/
        public void onClick(View view) {
            getActivity().finish();
        }
    });

    ((Button) view.findViewById(R.id.addProjectButton)).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if (ProjectNameET.getText().toString().equals("")) {
                Toast.makeText(getActivity(), "A project needs a name for people to recognise!",
                        Toast.LENGTH_SHORT).show();
                return;
            }

            JSONObject post = new JSONObject();
            try {
                post.put("project_name", ProjectNameET.getText().toString());
                post.put("project_synopsis", SynopsisET.getText().toString());
                post.put("project_desc", DescET.getText().toString());
                post.put("project_team", TeamMemberET.getText().toString());
                post.put("project_tech", TechET.getText().toString());
                post.put("auth", API.md5(API.BETTER_THAN_NOTHING_STUFF_TO_PREVENT_INJECTION_ATTEMPTS
                        + ProjectNameET.getText().toString()));
            } catch (Exception e) {
                e.printStackTrace();
                Toast.makeText(getActivity(),
                        "An Error Was encountered parsing the entered details: " + e.getMessage(),
                        Toast.LENGTH_SHORT).show();
                return;
            }

            JsonObjectRequest jsObjRequest = new JsonObjectRequest(Request.Method.POST,
                    "http://hackedioapp.networksaremadeofstring.co.uk/addproject.php", post,
                    new Response.Listener<JSONObject>() {
                        @Override
                        public void onResponse(JSONObject response) {
                            Log.e("response", response.toString());
                            try {
                                if (response.has("success") && response.getBoolean("success")) {
                                    Toast.makeText(getActivity(), "Project added successfully!",
                                            Toast.LENGTH_SHORT).show();

                                    if (getActivity().findViewById(R.id.ProjectDetails) != null) {
                                        Bundle arguments = new Bundle();
                                        arguments.putInt(ProjectDetailsFragment.PROJECTID,
                                                response.getInt("uuid"));
                                        arguments.putString(ProjectDetailsFragment.NAME,
                                                ProjectNameET.getText().toString());
                                        arguments.putString(ProjectDetailsFragment.SYNOPSIS,
                                                SynopsisET.getText().toString());
                                        arguments.putString(ProjectDetailsFragment.DESCRIPTION,
                                                DescET.getText().toString());
                                        arguments.putString(ProjectDetailsFragment.TECHNOLOGIES,
                                                TechET.getText().toString());
                                        arguments.putInt(ProjectDetailsFragment.POPULARITY, 1);
                                        arguments.putString(ProjectDetailsFragment.TEAMMEMBERS,
                                                TeamMemberET.getText().toString());
                                        arguments.putBoolean(ProjectDetailsFragment.ARG_2PANE, true);

                                        ProjectDetailsFragment fragment = new ProjectDetailsFragment();
                                        fragment.setArguments(arguments);
                                        fragment.setHasOptionsMenu(true);
                                        getActivity().getSupportFragmentManager().beginTransaction()
                                                .replace(R.id.ProjectDetails, fragment).commit();
                                    } else {
                                        getActivity().finish();

                                        Intent detailIntent = new Intent(getActivity(),
                                                ProjectDetailsActivity.class);
                                        detailIntent.putExtra(ProjectDetailsFragment.PROJECTID,
                                                response.getInt("uuid"));
                                        detailIntent.putExtra(ProjectDetailsFragment.NAME,
                                                ProjectNameET.getText().toString());
                                        detailIntent.putExtra(ProjectDetailsFragment.SYNOPSIS,
                                                SynopsisET.getText().toString());
                                        detailIntent.putExtra(ProjectDetailsFragment.DESCRIPTION,
                                                DescET.getText().toString());
                                        detailIntent.putExtra(ProjectDetailsFragment.TECHNOLOGIES,
                                                TechET.getText().toString());
                                        detailIntent.putExtra(ProjectDetailsFragment.POPULARITY, 1);
                                        detailIntent.putExtra(ProjectDetailsFragment.TEAMMEMBERS,
                                                TeamMemberET.getText().toString());
                                        detailIntent.putExtra(ProjectDetailsFragment.ARG_2PANE, true);
                                        startActivity(detailIntent);
                                    }
                                } else {
                                    String error = "";
                                    if (response.has("error"))
                                        error = ": " + response.getString("error");

                                    Toast.makeText(getActivity(), "An Error Was encountered" + error,
                                            Toast.LENGTH_SHORT).show();
                                }
                            } catch (Exception e) {
                                e.printStackTrace();
                                Toast.makeText(getActivity(), "An Error Was encountered: " + e.getMessage(),
                                        Toast.LENGTH_SHORT).show();
                            }

                        }
                    }, new Response.ErrorListener() {

                        @Override
                        public void onErrorResponse(VolleyError error) {
                            // TODO Auto-generated method stub
                            Toast.makeText(getActivity(), "An Error Was encountered: " + error.getMessage(),
                                    Toast.LENGTH_SHORT).show();
                        }
                    });

            queue.add(jsObjRequest);
        }
    });
    return view;
}

From source file:com.QuarkLabs.BTCeClient.adapters.OrdersBookAdapter.java

@SuppressLint("InflateParams")
@Override/*from  ww  w.  j  a va 2 s . c  om*/
public View getView(int position, View convertView, ViewGroup parent) {
    View v;
    if (convertView == null) {
        v = mInflater.inflate(R.layout.ordersbook_item, parent, false);
    } else {
        v = convertView;
    }
    JSONArray value = mData.optJSONArray(position);
    double price = value.optDouble(0);
    double volume = value.optDouble(1);
    TextView text1 = (TextView) v.findViewById(R.id.orderBookPrice);
    TextView text2 = (TextView) v.findViewById(R.id.ordersBookVolume);
    text1.setText(String.valueOf(price));
    text2.setText(String.valueOf(volume));
    if (volume == mMaxValue) {
        text1.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
        text2.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
    } else {
        text1.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
        text2.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
    }

    return v;
}