Skip to content

Instantly share code, notes, and snippets.

@francisnnumbi
francisnnumbi / LineNumberedEditText
Created May 16, 2017 08:32
implementing an EditText with line number on the left. What is new is: - get/set line number margin gap - set line number visible - set line number color Everything is done in the overridden onDraw() method.
import android.widget.*;
import android.util.*;
import android.content.*;
import android.graphics.*;
/**
* the simple implementation of an EditText where each line is numbered on the left
*/
public class LineNumberedEditText extends EditText {
@lifeparticle
lifeparticle / LICENSE
Last active February 9, 2023 11:22
Custom Edittext with Line Number
MIT License
Copyright (c) 2023 Mahbub Zaman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: