我在Polymer和Angular Material中看到了很多材料元素.据我所知,这两款产品都是google关于Material design的产品,它们之间有什么关系吗?有关Angular 2.0材质的计划吗?
我有一个带有DrawerLayout的活动但是无论什么时候它打开都有一个延迟,就像分秒,屏幕是白色的,然后画出我的屏幕.
转换结束后会发生这种情况.所以它有点像屏幕动画过渡是跳跃.
在将视图与ButterKnife绑定后,我尝试将它放在我的OnCreate上,但它没有做任何事情.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
postponeEnterTransition();
drawerLayout.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public boolean onPreDraw() {
drawerLayout.getViewTreeObserver().removeOnPreDrawListener(this);
startPostponedEnterTransition();
return true;
}
});
}
Run Code Online (Sandbox Code Playgroud)
是的我正在为Lollipop优化它,对于Lollipop之前的设备,我是jsut使用overridePendingTransitions,它工作正常.我的问题只在Lollipop设备上.
顺便说一句,我的Enter和Exit转换都是fade_in_out用xml定义的,并在其中指定styles
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="colorAccent">@color/pink</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:windowActivityTransitions">true</item>
<item name="android:windowContentTransitions">true</item>
<!-- specify enter and exit transitions -->
<!-- options are: explode, slide, fade -->
<item name="android:windowEnterTransition">@transition/fade_in_out_transition</item>
<item name="android:windowExitTransition">@transition/fade_in_out_transition</item>
<!-- specify shared element transitions -->
<item name="android:windowSharedElementEnterTransition">@transition/change_clip_bounds</item>
<item name="android:windowSharedElementExitTransition">@transition/change_clip_bounds</item>
<item name="android:windowSoftInputMode">stateAlwaysHidden|adjustResize</item>
</style>
Run Code Online (Sandbox Code Playgroud) alertDialog = new ProgressDialog(this);
alertDialog.setMessage(getResources().getString(R.string.loader));
alertDialog.setCancelable(false);
alertDialog.show();
Run Code Online (Sandbox Code Playgroud)
简单地说,当我这样做时,绿色圆圈显示除了它之外的单词loading.但是,当我不使用进度对话框,并且我在页面上使用进度条时,我得到一个粉红色,因为我在styles.xml中定义了以下内容
<item name="colorPrimary">@color/pink</item>
<item name="colorPrimaryDark">@color/pink</item>
<item name="colorAccent">@color/pink</item>
Run Code Online (Sandbox Code Playgroud)
获取圆形粉红色的解决方案是什么,如页面上的进度条?
以下材料文档,我:
import {MdDatepickerModule} from '@angular/material';
Run Code Online (Sandbox Code Playgroud)
在根模块中并将其添加到提供程序列表中,但是不能在模板中使用它.得到此错误:
未捕获(承诺):错误:MdDatepicker:找不到DateAdapter的提供程序.您必须在应用程序根目录中导入以下模块之一:MdNativeDateModule,或提供自定义实现.
所以根据它,我删除了最后一个导入并添加:
import {MdNativeDateModule} from '@angular/material';
Run Code Online (Sandbox Code Playgroud)
现在,看起来,它的工作原理.为什么Material docs会导致导入MdDatepickerModule,但不是MdNativeDateModule?它们有何区别?
有没有办法以编程方式更改原色.我想根据应用程序的屏幕/状态在代码中执行此操作.
目前我只能在主题中设置颜色(静态):
<item name="android:colorPrimary">@color/primary_color</item>
<item name="android:colorPrimaryDark">@color/dark_color</item>
<item name="android:colorBackground">@android:color/white</item>
<item name="android:colorAccent">@color/primary_color</item>
<item name="android:colorControlHighlight">@color/primary_color</item>
Run Code Online (Sandbox Code Playgroud)
谢谢
我在表格字段中使用Angula(4)+ Angular Material和Reactive Forms.我怎么能禁用它?我试过谷歌,但像残疾人="真"或类似的东西.你能告诉我正确的语法吗?这一定很容易.谢谢!
我的例子:
<mat-form-field class="xxx-form-full-with">
<textarea matInput placeholder="My description" formControlName="xxx"></textarea>
</mat-form-field>
Run Code Online (Sandbox Code Playgroud) 我将ActionBarSherlock更改为AppCompat v7.我已经完成了使其工作所需的所有更改,但是使用共享图标(使用ShareActionProvider)发生了一些奇怪的事情.与其他图标相比,共享图标太大.我也使用支持库进行搜索,其大小正确.问题在于共享图标.

my_menu.xml:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:moblee="http://schemas.android.com/apk/res-auto" >
<item
android:id="@+id/menu_share"
android:padding="10dp"
android:title="@string/menu_share"
moblee:actionProviderClass="android.support.v7.widget.ShareActionProvider"
moblee:showAsAction="always"/>
<item
android:id="@+id/menu_search"
android:title="@string/menu_search"
moblee:actionViewClass="android.support.v7.widget.SearchView"
moblee:showAsAction="always"/>
</menu>
Run Code Online (Sandbox Code Playgroud)
分段:
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.my_menu, menu);
MenuItem item = menu.findItem(R.id.menu_share);
ShareActionProvider shareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(item);
shareActionProvider.setShareIntent(getDefaultShareIntent());
}
Run Code Online (Sandbox Code Playgroud)
styles.xml
<style name="Theme.Custom" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/main_bar</item>
<item name="colorPrimaryDark">@color/main_bar</item>
<item name="actionBarItemBackground">@drawable/selectable_background_custom</item>
<item name="selectableItemBackground">@drawable/selectable_background_custom</item>
<item name="android:windowBackground">@color/background</item>
<item name="android:popupMenuStyle">@style/PopupMenu.Custom</item>
<item name="android:dropDownListViewStyle">@style/DropDownListView.Custom</item>
<item name="android:actionDropDownStyle">@style/DropDownNav.Custom</item>
<item name="android:actionModeBackground">@drawable/cab_background_top_custom</item>
<item name="android:actionModeSplitBackground">@drawable/cab_background_bottom_custom</item>
<item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Custom</item>
<item name="vpiTabPageIndicatorStyle">@style/VpiTabPageIndicator.Custom</item>
<item name="android:editTextBackground">@drawable/edit_text_holo_light</item>
<item name="android:listChoiceBackgroundIndicator">@drawable/list_selector_holo_light</item>
<item name="android:activatedBackgroundIndicator">@drawable/activated_background_holo_light</item>
<item name="android:fastScrollThumbDrawable">@drawable/fastscroll_thumb_holo</item>
<item name="android:listViewStyle">@style/ListViewCustom</item>
<item name="android:gridViewStyle">@style/GridViewCustom</item> …Run Code Online (Sandbox Code Playgroud) 是否可以在同一对象上显示对象的线框以及其面的纯色?我找到了一种方法,使用对象的克隆并分配不同的材料,例如
var geometry = new THREE.PlaneGeometry(plane.width, plane.height,width - 1, height - 1);
var materialWireframe = new THREE.MeshPhongMaterial({color:"red",wireframe:true});
var materialSolid = new THREE.MeshPhongMaterial({color:"green",wireframe:false});
var plane = new THREE.Mesh(geometry, materialWireframe );
var plane1 = plane.clone();
plane1.material = materialSolid ;
plane1.material.needsUpdate = true;
Run Code Online (Sandbox Code Playgroud)
有什么想法吗?
我必须创建像HotStarApp 这样的布局,但我有点混淆best way这样做:
我需要多个RecyclerViews还是单个RecyclerView就足够了?
我是否需要调用多个JSON或单个JSON足以从服务器获取数据?
我如何使用不同的 - 不同的布局,你可能也喜欢和必须观看剪辑