Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Studio 3.5.0 and Android X #766

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
/captures
gradle
.externalNativeBuild
.cxx

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • .cfx

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One year ago, you request .cfx ?

You could make an own pull request for this

14 changes: 7 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
compileSdkVersion 29
defaultConfig {
applicationId 'org.pocketworkstation.pckeyboard'
minSdkVersion 14
targetSdkVersion 26
targetSdkVersion 29
versionCode 1041001
versionName "v1.41.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags ""
Expand Down Expand Up @@ -38,9 +38,9 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation "com.android.support:support-compat:26.0.0"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.pocketworkstation.pckeyboard;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
Expand Down Expand Up @@ -45,7 +46,7 @@ public class CandidateView extends View {
private static final int OUT_OF_BOUNDS_X_COORD = -1;

private LatinIME mService;
private final ArrayList<CharSequence> mSuggestions = new ArrayList<CharSequence>();
private final ArrayList<CharSequence> mSuggestions = new ArrayList<>();
private boolean mShowingCompletions;
private CharSequence mSelectedString;
private int mSelectedIndex;
Expand All @@ -67,8 +68,6 @@ public class CandidateView extends View {

private final int[] mWordWidth = new int[MAX_SUGGESTIONS];
private final int[] mWordX = new int[MAX_SUGGESTIONS];
private int mPopupPreviewX;
private int mPopupPreviewY;

private static final int X_GAP = 10;

Expand All @@ -94,14 +93,13 @@ public class CandidateView extends View {
* @param context
* @param attrs
*/
@SuppressLint("InflateParams")
public CandidateView(Context context, AttributeSet attrs) {
super(context, attrs);
mSelectionHighlight = context.getResources().getDrawable(
R.drawable.list_selector_background_pressed);

LayoutInflater inflate =
(LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LayoutInflater inflate = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Resources res = context.getResources();
mPreviewPopup = new PopupWindow(context);
mPreviewText = (TextView) inflate.inflate(R.layout.candidate_preview, null);
Expand Down Expand Up @@ -335,7 +333,7 @@ public void setSuggestions(List<CharSequence> suggestions, boolean completions,
mTargetScrollX = 0;
mHaveMinimalSuggestion = haveMinimalSuggestion;
// Compute the total width
onDraw(null);
draw(null);
invalidate();
requestLayout();
}
Expand All @@ -345,7 +343,7 @@ public boolean isShowingAddToDictionaryHint() {
}

public void showAddToDictionaryHint(CharSequence word) {
ArrayList<CharSequence> suggestions = new ArrayList<CharSequence>();
ArrayList<CharSequence> suggestions = new ArrayList<>();
suggestions.add(word);
suggestions.add(mAddToDictionaryHint);
setSuggestions(suggestions, false, false, false);
Expand Down Expand Up @@ -457,9 +455,9 @@ private void showPreview(int wordIndex, String altText) {
+ mPreviewText.getPaddingLeft() + mPreviewText.getPaddingRight();
final int popupHeight = mPreviewText.getMeasuredHeight();
//mPreviewText.setVisibility(INVISIBLE);
mPopupPreviewX = mWordX[wordIndex] - mPreviewText.getPaddingLeft() - getScrollX()
int mPopupPreviewX = mWordX[wordIndex] - mPreviewText.getPaddingLeft() - getScrollX()
+ (mWordWidth[wordIndex] - wordWidth) / 2;
mPopupPreviewY = - popupHeight;
int mPopupPreviewY = -popupHeight;
int [] offsetInWindow = new int[2];
getLocationInWindow(offsetInWindow);
if (mPreviewPopup.isShowing()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
import android.os.Vibrator;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationManagerCompat;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
Expand Down
8 changes: 1 addition & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.5.0'
}
}

Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down
2 changes: 1 addition & 1 deletion java/AutoVersion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Id="$(git describe --tags)"

Ver="$Id $(date +%Y-%m-%d)"

if [ ."$1" = ."reset" ]; then
if [[ ."$1" = ."reset" ]]; then
Ver="custom"
else
echo "*** Version: $Ver"
Expand Down
8 changes: 4 additions & 4 deletions java/CheckMaps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ mkdir -p "$Out"

for Dir in res/values res/values-*
do
[ -f $Dir/$Map ] || continue # -o -f $Dir/$Alt ] || continue
[[ -f ${Dir}/${Map} ]] || continue # -o -f $Dir/$Alt ] || continue
Args="$Res/values/$Alt"
[ -f $Dir/$Alt ] && Args="$Args $Dir/$Alt"
[[ -f ${Dir}/${Alt} ]] && Args="$Args $Dir/$Alt"
Args="$Args $Res/values/$Map"
[ -f $Dir/$Map ] && Args="$Args $Dir/$Map"
if [ -n "$CONVERT_MAPS" ]; then
[[ -f ${Dir}/${Map} ]] && Args="$Args $Dir/$Map"
if [[ -n "$CONVERT_MAPS" ]]; then
Loc=$(echo "$Dir" | sed 's/res.values-*//; s/\/$//; s/^$/en/')
perl CheckMap.pl -c $Args > "$Out/map-full-$Loc.txt"
else
Expand Down