Git Product home page Git Product logo

justifiedtextview's Introduction

JustifiedTextView for Android

This project provides a view for android apps that implements justified text view.

Screenshot

Android 2.0+ support

Quick Setup

1. Include library

Manual:

  • Downlaod the JustifiedTextView Library
  • Add it to your eclipse workspace
  • there is a sample project with the library that you can import as well
  • Go to your project properties and add JustifiedTextView as library

2. Application class

public class MainActivity extends Activity {

	private JustifiedTextView mJTv;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		mJTv=(JustifiedTextView) findViewById(R.id.activity_main_jtv_text);
		mJTv.setText(getResources().getString(R.string.test));
		mJTv.setTextSize(TypedValue.COMPLEX_UNIT_SP,20);
		mJTv.setLineSpacing(15);
		mJTv.setBackgroundColor(Color.RED);
		mJTv.setAlignment(Align.LEFT);
		mJTv.setTypeFace(Typeface.createFromAsset(getAssets(), "fonts/naskh_bold.ttf"));

	}
}

3. Xml

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main_jsv"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ir.noghteh.JustifiedTextView
        android:id="@+id/activity_main_jtv_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="right"
        android:padding="25dp"
		xmlns:noghteh="http://noghteh.ir"
        noghteh:text="@string/hello_world"
        noghteh:textColor="@color/text"
        noghteh:textSize="18sp"
       >
    </ir.noghteh.JustifiedTextView>

</ScrollView>

4.License

please inform us if you use this library ( navabi70-at-gmail)

Copyright 2013-2014 Mohsen Navabi

justifiedtextview's People

Contributors

navabi avatar patriotblog avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.