Giter Site home page Giter Site logo

applocale's People

Contributors

b3nedikt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

applocale's Issues

Caused by java.lang.ClassCastException: yb.c cannot be cast to android.app.ContextImpl

Hello! Is there a chance that application context wrapping:

    override fun attachBaseContext(newBase: Context) {
        super.attachBaseContext(AppLocale.wrap(newBase))
    }

will not work for some cases, where particular Context implementation is expected internally?
It seems like we're getting the next exceptions with androidx.work because of this:

Fatal Exception: java.lang.RuntimeException: Unable to start receiver androidx.work.impl.background.systemalarm.RescheduleReceiver: java.lang.ClassCastException: yb.c cannot be cast to android.app.ContextImpl
       at android.app.ActivityThread.handleReceiver(ActivityThread.java:3107)
       at android.app.ActivityThread.-wrap18(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1611)
       at android.os.Handler.dispatchMessage(Handler.java:110)
       at android.os.Looper.loop(Looper.java:203)
       at android.app.ActivityThread.main(ActivityThread.java:6251)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)

(We've got only obfuscated stack trace for now (yb.c), but I'll try to get a normal one if that can help)

Doesn't persist desired locale.

Thanks for the great codebase.

After integration, I have observed that V1.2.6 is not persisting in the desired locale.

After changing the desired locale, if you close the app from recent and reopen again then you will observe that it's not persisting the desired locale.

Demo Video

Unable to set the Locale to Arabic

HI,

I have integrated the AppLocale library and able to change to other languages like French, but I am not able to switch to Arabic.
The Kotlin code used to set Arabic is:
AppLocale.desiredLocale = Locale("ar")

After setting the locale, Im also using reword to trigger the change.

I have placed the Arabic strings in their respective values-ar strings.xml file
Please let me know if I am doing any mistake or does AppLocale support Arabic language?

Im also having one more issue:
When I change the language for example from English to French, the Appbar/toolbar title is not being changed as per the Locale. Im using Jetpack Navigation in my app. Titles for these destinations are set in the navigation.xml file using string resources.
The reword_version = "4.0.1"

Your feedback will be of great help. Thanks in advance.

Webview is crashing, but not able to reproduce exact case.

Hi,
Webview is crashing, but not able to reproduce exact case. we have used the below version of the restring library
restrings = '5.1.4'
viewpump = '4.0.7'
reword = '4.0.1'
applocale = '2.0.3'

we are using 1.3.1 of appcompact.

below is the crash from stack trace which is not reproducable everytime, i was just trying to navigate to different window or something inside webview then i got this crash.

E/ViewSystem: ViewRootImpl #2 Surface is not valid.
E/ViewRootImpl: sendUserActionEvent() mView == null
E/ViewSystem: ViewRootImpl #2 Surface is not valid.
E/ViewSystem: ViewRootImpl #2 Surface is not valid.
E/MotionRecognitionManager: mSContextService = null
E/MotionRecognitionManager: motionService = null
E/WebEngage: App has crashed
android.content.res.Resources$NotFoundException: String resource ID #0x313004a
E/SensorManager: nativeGetSensorAtIndex: name, vendor - 0, K2HH Acceleration , STM
E/SensorManager: nativeGetSensorAtIndex: name, vendor - 1, GP2A002 Proximity Sensor, SHARP
E/SensorManager: nativeGetSensorAtIndex: name, vendor - 2, Screen Orientation Sensor, Samsung Electronics
E/File: fail readDirectory() errno=2
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.next.nlp, PID: 16554
android.content.res.Resources$NotFoundException: String resource ID #0x313004a
at android.content.res.Resources.getText(Resources.java:1484)
at android.content.res.Resources.getString(Resources.java:1580)
at dev.b3nedikt.restring.internal.ResourcesDelegate.getString(ResourcesDelegate.kt:50)
at dev.b3nedikt.restring.internal.RestringResources.getString(RestringResources.kt:41)
at android.content.Context.getString(Context.java:415)
at org.chromium.content.browser.selection.SelectionPopupControllerImpl.j(chromium-SystemWebViewGoogle.aab-stable-460607100:49)
at b9.onActionItemClicked(chromium-SystemWebViewGoogle.aab-stable-460607100:19)
at my.onActionItemClicked(chromium-SystemWebViewGoogle.aab-stable-460607100:1)
at com.android.internal.policy.PhoneWindow$DecorView$ActionModeCallback2Wrapper.onActionItemClicked(PhoneWindow.java:4234)
at com.android.internal.view.FloatingActionMode$4.onMenuItemSelected(FloatingActionMode.java:108)
at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:801)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:158)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:954)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:944)
at com.android.internal.view.FloatingActionMode$5.onMenuItemClick(FloatingActionMode.java:138)
at com.android.internal.widget.FloatingToolbar$FloatingToolbarMainPanel$1.onClick(FloatingToolbar.java:1298)
at android.view.View.performClick(View.java:5716)
at android.widget.TextView.performClick(TextView.java:10926)
at android.view.View$PerformClick.run(View.java:22596)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
E/File: fail readDirectory() errno=2
E/File: fail readDirectory() errno=2
E/WebEngage: App was crashed last time,

java.lang.ClassCastException: dev.b3nedikt.app_locale.AppLocaleContextWrapper cannot be cast to android.app.ContextImpl

2023/02/08 09:36:14.225 : [CRASH] Unable to instantiate receiver androidx.work.impl.background.systemalarm.RescheduleReceiver: java.lang.ClassCastException: dev.b3nedikt.app_locale.AppLocaleContextWrapper cannot be cast to android.app.ContextImpl
2023/02/08 09:36:14.250 : [TRACE] android.app.ActivityThread.handleReceiver(ActivityThread.java:4929)
2023/02/08 09:36:14.265 : [TRACE] android.app.ActivityThread.access$1900(ActivityThread.java:324)
2023/02/08 09:36:14.277 : [TRACE] android.app.ActivityThread$H.handleMessage(ActivityThread.java:2347)
2023/02/08 09:36:14.290 : [TRACE] android.os.Handler.dispatchMessage(Handler.java:106)
2023/02/08 09:36:14.321 : [TRACE] android.os.Looper.loopOnce(Looper.java:226)
2023/02/08 09:36:14.333 : [TRACE] android.os.Looper.loop(Looper.java:313)
2023/02/08 09:36:14.341 : [TRACE] android.app.ActivityThread.main(ActivityThread.java:8855)
2023/02/08 09:36:14.349 : [TRACE] java.lang.reflect.Method.invoke(Native Method)
2023/02/08 09:36:14.355 : [TRACE] com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
2023/02/08 09:36:14.363 : [TRACE] com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

IllegalStateException: A factory has already been set on this LayoutInflate

Hi, currently i am using Dagger in my project and my BaseFragment extends DaggerFragment. However when i launch my app and launch any of my fragment i got this exception in the BaseFragment.

override fun onGetLayoutInflater(savedInstanceState: Bundle?): LayoutInflater {
        val wrappedContext = ViewPumpContextWrapper.wrap(AppLocale.wrap(requireContext()))
        //the exception happens in below line
        return wrappedContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
}

How can solve this?
Thanks.

SearchView not worked

I have this attribute in SearchView:
android:queryHint="@string/search_hint"
he doesn't switch language

    <SearchView
        android:id="@+id/sw_search"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:iconifiedByDefault="false"
        android:inputType="textCapSentences"
        android:queryBackground="@android:color/transparent"
        android:queryHint="@string/search_hint"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/quantityStringTextView" />

But,
EditText with attribute:
android:hint="@string/search_hint"
works well

WebEngage Runtime Exception

java.lang.RuntimeException: Unable to instantiate receiver com.webengage.sdk.android.WebEngageReceiver: java.lang.ClassCastException: dev.b3nedikt.app_locale.AppLocaleContextWrapper cannot be cast to android.app.ContextImpl
at android.app.ActivityThread.handleReceiver(ActivityThread.java:4012)
at android.app.ActivityThread.access$1400(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1924)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7660)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.ClassCastException: dev.b3nedikt.app_locale.AppLocaleContextWrapper cannot be cast to android.app.ContextImpl
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3996)
at android.app.ActivityThread.access$1400(ActivityThread.java:237) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1924) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:223) 
at android.app.ActivityThread.main(ActivityThread.java:7660) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Application start error

I see this error when I run the application from the studio.
When you run the application from your phone, no errors occur.

java.lang.RuntimeException: Unable to start receiver com.evernote.android.job.patched.internal.JobBootReceiver: java.lang.ClassCastException: dev.b3nedikt.app_locale.AppLocaleContextWrapper cannot be cast to android.app.ContextImpl
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2732)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.ClassCastException: dev.b3nedikt.app_locale.AppLocaleContextWrapper cannot be cast to android.app.ContextImpl
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2722)
at android.app.ActivityThread.-wrap14(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5417) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.