Solution :
Seems that I need to add also adjustResize on my manifest :
android:windowSoftInputMode="adjustResize"
//TODO
further investigate that behavior
public class MainActivity extends Activity implements TopFragment.OnItemAddedListener {
private ArrayList todoItems;
private TaskListAdapter aa;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Get references to the Fragments
FragmentManager fm = getFragmentManager();
TaskListFragment todoListFragment =
(TaskListFragment)fm.findFragmentById(R.id.TaskListFragment);
// Create the array list of to do items
todoItems = new ArrayList();
// Create the array adapter to bind the array to the ListView
int resID = R.layout.tasklist_fragment;
aa = new TaskListAdapter(this, resID, todoItems);
// Bind the array adapter to the ListView.
todoListFragment.setListAdapter(aa);
}
public void onNewItemAdded(String newItem) {
DataItem newTodoItem = new DataItem(newItem);
todoItems.add(0, newTodoItem);
aa.notifyDataSetChanged();
}
}
public class MyEditText extends EditText {
private Rect mRect;
private Paint mPaint;
private int attrColor;
public MyEditText(Context context) {
super(context);
}
public MyEditText(Context context, AttributeSet attrs) {
super(context, attrs);
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.MyEditText);
attrColor = ta.getInteger(R.styleable.MyEditText_attr_color, 0xff00ff00);
ta.recycle();
init();
}
public void init() {
mRect = new Rect();
mPaint = new Paint();
mPaint.setStyle(Paint.Style.FILL);
mPaint.setColor(attrColor); //get value from attr
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
int count = getLineCount();
Rect r = mRect;
Paint p = mPaint;
for(int i=0; i< count; i++) {
int baseline = getLineBounds(i, r);
canvas.drawLine(r.left, baseline + 1, r.right, baseline + 1, p);
}
}
}
include ':MyDemo', ':MyLibProject' apply plugin: 'android' where for Library Project apply plugin : 'android-plugin'gradlew tasks to see all available tasks. gradlew assemble to build the project andgradlew installDebug to install it to the connected devices.