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

如何使插件apk背景为透明 #19

Open
ymcao opened this issue Dec 9, 2014 · 9 comments
Open

如何使插件apk背景为透明 #19

ymcao opened this issue Dec 9, 2014 · 9 comments

Comments

@ymcao
Copy link

ymcao commented Dec 9, 2014

插件apk我设置了主题为透明,但用宿主apk调用的时候,插件apk不是透明,而是黑色的?

@kymjs
Copy link
Owner

kymjs commented Dec 9, 2014

设置透明,需要把宿主apk中托管所Activity设置为透明

@ymcao
Copy link
Author

ymcao commented Dec 9, 2014

这个托管所Activity透过android:theme方式设置透明会报错

@ymcao
Copy link
Author

ymcao commented Dec 9, 2014

报错 :
12-09 13:19:56.724: E/AndroidRuntime(5798): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x1010059 a=-1}
12-09 13:19:56.724: E/AndroidRuntime(5798): at android.content.res.Resources.loadDrawable(Resources.java:2946)
12-09 13:19:56.724: E/AndroidRuntime(5798): at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
12-09 13:19:56.724: E/AndroidRuntime(5798): at android.widget.FrameLayout.(FrameLayout.java:109)
12-09 13:19:56.724: E/AndroidRuntime(5798): at android.widget.FrameLayout.(FrameLayout.java:97)
12-09 13:19:56.724: E/AndroidRuntime(5798): ... 32 more

@kymjs
Copy link
Owner

kymjs commented Dec 9, 2014

在你自己的应用的Manifest文件里面设置,不是lib工程的Manifest

@ymcao
Copy link
Author

ymcao commented Dec 9, 2014

就是在我自己写的工程的manifest配置的

@kymjs
Copy link
Owner

kymjs commented Dec 9, 2014

资源无法找到,你的Drawable复制一份到lib工程里面试试

@ymcao
Copy link
Author

ymcao commented Dec 9, 2014

这是我新建的工程的manifest.xml

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="21" />

<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.BATTERY_STATS" />
<uses-permission android:name="android.permission.GET_PACKAGE_SIZE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
         >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="org.kymjs.aframe.plugin.activity.CJProxyActivity"
        android:theme="@style/AppTheme" />
</application>

@ymcao
Copy link
Author

ymcao commented Dec 9, 2014

我只是stylle.xml里面设置了这个属性,没涉及drawable,我把这个style.xml lib工程也放了,还是报同样的错误

<style name="AppTheme" parent="android:Theme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
    <item name="android:windowIsTranslucent">true</item>
</style>

@singwhatiwanna
Copy link

这种问题,建议在插件透明的activity中重新代码设置透明效果比较好,因为,无法支持插件透明主题,包括dl也是的。暂时还不知道怎么解决。如果把proxy设置为透明主题,那么三星手机可能会报错。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants