Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added notes fragement to file chooser, recent files are not added to …
…the system wide recent files list, nots provider supports search now and various other improvements
- Loading branch information
Christian Gogolin
committed
Dec 18, 2015
1 parent
e6d7af4
commit eece517
Showing
7 changed files
with
131 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
platform/android/src/com/cgogolin/penandpdf/TextDrawable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.cgogolin.penandpdf; | ||
|
||
//Code mostly taken from http://stackoverflow.com/questions/19788386/set-unchangeable-some-part-of-edittext-android/19789317#19789317 and slightly edited | ||
|
||
import android.graphics.drawable.Drawable; | ||
import android.graphics.Paint; | ||
import android.graphics.Canvas; | ||
import android.graphics.ColorFilter; | ||
import android.graphics.PixelFormat; | ||
import java.lang.Math; | ||
|
||
|
||
public class TextDrawable extends Drawable { | ||
|
||
private final String text; | ||
private final Paint paint; | ||
|
||
public TextDrawable(String text, float textSize, int color) { | ||
this.text = text; | ||
this.paint = new Paint(); | ||
paint.setColor(color); | ||
paint.setTextSize(textSize); | ||
paint.setAntiAlias(true); | ||
paint.setTextAlign(Paint.Align.LEFT); | ||
} | ||
|
||
@Override | ||
public void draw(Canvas canvas) { | ||
canvas.drawText(text, 0, 6, paint); | ||
} | ||
|
||
@Override | ||
public void setAlpha(int alpha) { | ||
paint.setAlpha(alpha); | ||
} | ||
|
||
@Override | ||
public void setColorFilter(ColorFilter cf) { | ||
paint.setColorFilter(cf); | ||
} | ||
|
||
@Override | ||
public int getOpacity() { | ||
return PixelFormat.TRANSLUCENT; | ||
} | ||
|
||
@Override | ||
public int getIntrinsicWidth() { | ||
return (int)Math.ceil(paint.measureText(text)); | ||
} | ||
} |