-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 24 | ||
buildToolsVersion "24.0.2" | ||
|
||
defaultConfig { | ||
applicationId "com.androkurd.keyboard_ku_en" | ||
minSdkVersion 23 | ||
targetSdkVersion 24 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
testCompile 'junit:junit:4.12' | ||
compile 'com.android.support:appcompat-v7:24.2.0' | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in C:\Users\HI\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.androkurd.keyboard_ku_en"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<service android:name=".keyboard_androkurd" | ||
android:label="@string/app_name" | ||
android:permission="android.permission.BIND_INPUT_METHOD" | ||
> | ||
<meta-data android:name="android.view.im" android:resource="@xml/method"/> | ||
<intent-filter> | ||
<action android:name="android.view.InputMethod" /> | ||
</intent-filter> | ||
</service> | ||
</application> | ||
|
||
</manifest> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
package com.androkurd.keyboard_ku_en; | ||
|
||
|
||
import android.inputmethodservice.InputMethodService; | ||
import android.inputmethodservice.Keyboard; | ||
import android.inputmethodservice.KeyboardView; | ||
import android.media.AudioManager; | ||
import android.view.KeyEvent; | ||
import android.view.View; | ||
import android.view.inputmethod.InputConnection; | ||
|
||
public class keyboard_androkurd extends InputMethodService | ||
implements KeyboardView.OnKeyboardActionListener { | ||
@Override | ||
public View onCreateInputView() { | ||
kv = (KeyboardView)getLayoutInflater().inflate(R.layout.keyboard, null); | ||
keyboard = new Keyboard(this, R.xml.qwerty); | ||
kv.setKeyboard(keyboard); | ||
kv.setOnKeyboardActionListener(this); | ||
return kv; | ||
} | ||
|
||
private KeyboardView kv; | ||
private Keyboard keyboard; | ||
|
||
private boolean caps = false; | ||
|
||
@Override | ||
public void onKey(int primaryCode, int[] keyCodes) { | ||
InputConnection ic = getCurrentInputConnection(); | ||
playClick(primaryCode); | ||
switch(primaryCode){ | ||
case Keyboard.KEYCODE_DELETE : | ||
ic.deleteSurroundingText(1, 0); | ||
break; | ||
case Keyboard.KEYCODE_SHIFT: | ||
caps = !caps; | ||
keyboard.setShifted(caps); | ||
kv.invalidateAllKeys(); | ||
break; | ||
case Keyboard.KEYCODE_DONE: | ||
ic.sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER)); | ||
break; | ||
default: | ||
char code = (char)primaryCode; | ||
if(Character.isLetter(code) && caps){ | ||
code = Character.toUpperCase(code); | ||
} | ||
ic.commitText(String.valueOf(code),1); | ||
} | ||
} | ||
|
||
private void playClick(int keyCode){ | ||
AudioManager am = (AudioManager)getSystemService(AUDIO_SERVICE); | ||
switch(keyCode){ | ||
case 32: | ||
am.playSoundEffect(AudioManager.FX_KEYPRESS_SPACEBAR); | ||
break; | ||
case Keyboard.KEYCODE_DONE: | ||
case 10: | ||
am.playSoundEffect(AudioManager.FX_KEYPRESS_RETURN); | ||
break; | ||
case Keyboard.KEYCODE_DELETE: | ||
am.playSoundEffect(AudioManager.FX_KEYPRESS_DELETE); | ||
break; | ||
default: am.playSoundEffect(AudioManager.FX_KEYPRESS_STANDARD); | ||
} | ||
} | ||
|
||
@Override | ||
public void onPress(int primaryCode) { | ||
} | ||
|
||
@Override | ||
public void onRelease(int primaryCode) { | ||
} | ||
|
||
@Override | ||
public void onText(CharSequence text) { | ||
} | ||
|
||
@Override | ||
public void swipeDown() { | ||
} | ||
|
||
@Override | ||
public void swipeLeft() { | ||
} | ||
|
||
@Override | ||
public void swipeRight() { | ||
} | ||
|
||
@Override | ||
public void swipeUp() { | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<android.inputmethodservice.KeyboardView | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:id="@+id/keyboard" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_alignParentBottom="true" | ||
android:keyPreviewLayout ="@layout/preview" | ||
/> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<TextView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:gravity="center" | ||
android:background="#ffff00" | ||
android:textStyle="bold" | ||
android:textSize="30sp"> | ||
</TextView> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<resources> | ||
<!-- Example customization of dimensions originally defined in res/values/dimens.xml | ||
(such as screen margins) for screens with more than 820dp of available width. This | ||
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). --> | ||
<dimen name="activity_horizontal_margin">64dp</dimen> | ||
</resources> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="colorPrimary">#3F51B5</color> | ||
<color name="colorPrimaryDark">#303F9F</color> | ||
<color name="colorAccent">#FF4081</color> | ||
</resources> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<resources> | ||
<!-- Default screen margins, per the Android Design guidelines. --> | ||
<dimen name="activity_horizontal_margin">16dp</dimen> | ||
<dimen name="activity_vertical_margin">16dp</dimen> | ||
</resources> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="app_name">Androkurd_Keyboard</string> | ||
<string name="keyboard_ime">AndoKurd_Key</string> | ||
<string name="subtype_ku_en">kurdish And english</string> | ||
</resources> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<resources> | ||
|
||
<!-- Base application theme. --> | ||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> | ||
<!-- Customize your theme here. --> | ||
<item name="colorPrimary">@color/colorPrimary</item> | ||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> | ||
<item name="colorAccent">@color/colorAccent</item> | ||
</style> | ||
|
||
</resources> |