Android Open Source - inotes Lined Edit Text






From Project

Back to project page inotes.

License

The source code is released under:

GNU General Public License

If you think the Android project inotes 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.codeminders.inotes.ui;
//from w  w  w .j  av a  2s  . co  m
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.widget.EditText;
import com.codeminders.inotes.R;

public class LinedEditText extends EditText {
    private Rect rect;
    private Paint paint;

    public LinedEditText(Context context, AttributeSet attrs) {
        super(context, attrs);

        rect = new Rect();
        paint = new Paint();
        paint.setStyle(Paint.Style.FILL_AND_STROKE);
        paint.setColor(Color.parseColor(context.getString((R.color.lined_edit_line))));
    }

    @Override
    protected void onDraw(Canvas canvas) {
        int height = getHeight();
        int line_height = getLineHeight();

        int count = height / line_height;

        if (getLineCount() > count) {
            count = getLineCount();
        }

        int baseline = getLineBounds(0, rect);

        for (int i = 0; i < count; i++) {

            canvas.drawLine(rect.left, baseline + 1, rect.right, baseline + 1, paint);
            baseline += getLineHeight();
        }

        super.onDraw(canvas);
    }

}




Java Source Code List

com.codeminders.inotes.AccountReceiver.java
com.codeminders.inotes.Constants.java
com.codeminders.inotes.Utils.java
com.codeminders.inotes.auth.AuthenticationService.java
com.codeminders.inotes.auth.AuthenticatorActivity.java
com.codeminders.inotes.auth.Authenticator.java
com.codeminders.inotes.auth.ConfigurationActivity.java
com.codeminders.inotes.db.DBCreator.java
com.codeminders.inotes.db.DBManager.java
com.codeminders.inotes.db.DBUpgradeHelper.java
com.codeminders.inotes.imap.HeaderUtils.java
com.codeminders.inotes.imap.ImapService.java
com.codeminders.inotes.imap.ImapSession.java
com.codeminders.inotes.model.AccountInfo.java
com.codeminders.inotes.model.Note.java
com.codeminders.inotes.sync.NotesProvider.java
com.codeminders.inotes.sync.NotesSyncService.java
com.codeminders.inotes.sync.SyncAccountInfo.java
com.codeminders.inotes.sync.SyncAdapter.java
com.codeminders.inotes.sync.SyncAllAccountsInfo.java
com.codeminders.inotes.sync.SyncHelper.java
com.codeminders.inotes.sync.SyncInfo.java
com.codeminders.inotes.ui.AccountsListActivity.java
com.codeminders.inotes.ui.LinedEditText.java
com.codeminders.inotes.ui.NoteEditorActivity.java
com.codeminders.inotes.ui.NotesListActivity.java
com.codeminders.inotes.ui.SettingsActivity.java