-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from virtualprodigy/bug-fix/xmlNameSpace_Dialog…
…ForTTFInDemo Bug fix/xml name space dialog for ttf in demo
- Loading branch information
Showing
11 changed files
with
105 additions
and
12 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 51 additions & 1 deletion
52
...extViewSample/app/src/main/java/com/virtualprodigy/bettertextviewsample/MainActivity.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 |
---|---|---|
@@ -1,13 +1,63 @@ | ||
package com.virtualprodigy.bettertextviewsample; | ||
|
||
import android.content.Context; | ||
import android.graphics.Typeface; | ||
import android.support.v7.app.AlertDialog; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.view.LayoutInflater; | ||
import android.view.Menu; | ||
import android.view.MenuInflater; | ||
import android.view.MenuItem; | ||
import android.view.View; | ||
import android.webkit.WebView; | ||
import android.widget.TextView; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
|
||
Context context; | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
context = this; | ||
|
||
} | ||
|
||
|
||
@Override | ||
public boolean onCreateOptionsMenu(Menu menu) { | ||
MenuInflater inflater = getMenuInflater(); | ||
inflater.inflate(R.menu.menu, menu); | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean onOptionsItemSelected(MenuItem item) { | ||
// Handle item selection | ||
switch (item.getItemId()) { | ||
case R.id.font_license: | ||
displayChangeLog(); | ||
return true; | ||
|
||
default: | ||
return super.onOptionsItemSelected(item); | ||
} | ||
} | ||
|
||
/** | ||
* Display the webview with the license for the Dancing font | ||
*/ | ||
private void displayChangeLog() { | ||
|
||
WebView webview = new WebView(context); | ||
webview.loadUrl("file:///android_asset/fonts/dancing_script_license.html"); | ||
|
||
AlertDialog dialog = new AlertDialog.Builder(context) | ||
.setTitle("Dancing Script License") | ||
.setView(webview) | ||
.setPositiveButton("ok",null) | ||
.create(); | ||
dialog.show(); | ||
|
||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<menu xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<item | ||
android:id="@+id/font_license" | ||
app:showAsAction="never" | ||
android:title="font license" /> | ||
|
||
|
||
</menu> |
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
5 changes: 1 addition & 4 deletions
5
BetterTextViewSample/bettertextview/src/main/AndroidManifest.xml
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 |
---|---|---|
@@ -1,9 +1,6 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.virtualprodigy.bettertextview"> | ||
|
||
<application android:allowBackup="true" android:label="@string/app_name" | ||
android:supportsRtl="true"> | ||
|
||
</application> | ||
<application/> | ||
|
||
</manifest> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
# BetterTextView | ||
A Custom Android TextView With some upgrades | ||
A custom Android TextView with some upgrades. | ||
|
||
#Description | ||
This small library is a slightly upgraded version of Android's standard TextView. It currently features the ability | ||
to set the Type Face via XML. | ||
|
||
|
||
|
||
#Feature Features | ||
### 1. Automatically sizing the font to fit within a TextView's bound. | ||
### 2. Maven distribution | ||
|
||
|
||
#Change Log | ||
###Version 1.0 | ||
1. Users can add their typeface view xml | ||
|
||
|
||
#License | ||
Copyright 2016 Matthew Butler | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |