This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Support Thai keyboard. * Adding domain names for Chinese keyboard. * Correct Swedish dot symbol.
- Loading branch information
1 parent
3481381
commit 93be5bc
Showing
15 changed files
with
418 additions
and
13 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
110 changes: 110 additions & 0 deletions
110
app/src/common/shared/org/mozilla/vrbrowser/ui/keyboards/ThaiKeyboard.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,110 @@ | ||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*- | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
package org.mozilla.vrbrowser.ui.keyboards; | ||
|
||
import android.content.Context; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
|
||
import org.mozilla.vrbrowser.R; | ||
import org.mozilla.vrbrowser.input.CustomKeyboard; | ||
import org.mozilla.vrbrowser.ui.widgets.WidgetPlacement; | ||
import org.mozilla.vrbrowser.utils.StringUtils; | ||
|
||
import java.util.Locale; | ||
|
||
public class ThaiKeyboard extends BaseKeyboard { | ||
private Locale mLocale; | ||
private CustomKeyboard mKeyboard; | ||
private CustomKeyboard mCapKeyboard; | ||
private CustomKeyboard mSymbolsKeyboard; | ||
|
||
public ThaiKeyboard(Context aContext) { | ||
super(aContext); | ||
mLocale = new Locale("th", "TH"); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public CustomKeyboard getAlphabeticKeyboard() { | ||
if (mKeyboard == null) { | ||
mKeyboard = new CustomKeyboard(mContext.getApplicationContext(), R.xml.keyboard_qwerty_thai); | ||
mKeyboard.setShifted(false); | ||
} | ||
return mKeyboard; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public CustomKeyboard getAlphabeticCapKeyboard() { | ||
if (mCapKeyboard == null) { | ||
mCapKeyboard = new CustomKeyboard(mContext.getApplicationContext(), R.xml.keyboard_qwerty_thai_cap); | ||
mCapKeyboard.setShifted(true); | ||
} | ||
return mCapKeyboard; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public CustomKeyboard getSymbolsKeyboard() { | ||
if (mSymbolsKeyboard == null) { | ||
mSymbolsKeyboard = new CustomKeyboard(mContext.getApplicationContext(), R.xml.keyboard_symbols_thai); | ||
} | ||
return mSymbolsKeyboard; | ||
} | ||
|
||
@Override | ||
public float getKeyboardTranslateYInWorld() { | ||
return WidgetPlacement.unitFromMeters(mContext, R.dimen.keyboard_y_extra_row); | ||
} | ||
|
||
@Override | ||
public float getKeyboardWorldWidth() { | ||
return WidgetPlacement.floatDimension(mContext, R.dimen.keyboard_world_extra_row_width); | ||
} | ||
|
||
@Override | ||
public float getAlphabeticKeyboardWidth() { | ||
return WidgetPlacement.dpDimension(mContext, R.dimen.keyboard_alphabetic_width_extra_column); | ||
} | ||
|
||
@Override | ||
public float getAlphabeticKeyboardHeight() { | ||
return WidgetPlacement.dpDimension(mContext, R.dimen.keyboard_alphabetic_height_thai); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public CandidatesResult getCandidates(String aText) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getKeyboardTitle() { | ||
return StringUtils.getStringByLocale(mContext, R.string.settings_language_thai, getLocale()); | ||
} | ||
|
||
@Override | ||
public Locale getLocale() { | ||
return mLocale; | ||
} | ||
|
||
@Override | ||
public String getSpaceKeyText(String aComposingText) { | ||
return StringUtils.getStringByLocale(mContext, R.string.settings_language_thai, getLocale()); | ||
} | ||
|
||
@Override | ||
public String getModeChangeKeyText() { | ||
return mContext.getString(R.string.thai_keyboard_mode_change); | ||
} | ||
|
||
@Override | ||
public String[] getDomains(String... domains) { | ||
return super.getDomains(".th"); | ||
} | ||
} |
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
Oops, something went wrong.