我有一个在回收站视图中具有名称的项目和一个带有折叠工具栏的详细信息活动,该工具栏显示项目的名称.我想在项目名称和工具栏/折叠工具栏的标题之间添加一个sharedelement转换.
item_subject.xml
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<FrameLayout
android:id="@+id/frameLayoutSubjectColor"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:minWidth="20dp" />
<TextView
android:id="@+id/textViewSubjectName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="10dp"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
activity_subject_detail.xml
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:id="@+id/appBarLayout"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/subject_detail_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/activity_horizontal_margin"
android:orientation="vertical">
<TextView
android:id="@+id/textViewSubjectShort"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="16dp"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textViewSubjectRoom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="32dp"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textViewTeacher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" …Run Code Online (Sandbox Code Playgroud) android shared-element-transition android-collapsingtoolbarlayout
我有一个带有recyclerview(GridlayoutManager)的片段.recyclerview中的项目并不复杂或有图像,但向下滚动Recyclerview滞后(在Nexus 5上测试).我将hasFixedSize和hasStableIds设置为true有谁知道为什么会这样?提前致谢.
分段
public class EditTimetableFragment extends Fragment implements TimetableRecyclerViewAdapter.ClickListener {
public EditTimetableFragment() {}
DAO dao;
SharedPreferences sharedPreferences;
SharedPreferences.Editor editor;
RecyclerView recyclerViewTimetable;
Spinner spinnerSubject;
TimetableRecyclerViewAdapter timetableRecyclerViewAdapter;
TaskSubjectSpinnerAdapter taskSubjectSpinnerAdapter;
List<Subject> subjectList;
List<Timetable> timetableList;
FloatingActionButton fabAddSubject;
boolean saturday, sunday;
int dayLength, hourLength;
TextView textViewSa, textViewSu;
LinearLayout week, linearLayout;
View view;
public View getView() {
return view;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this
dao = new DAO(getActivity());
getTimetableSettings();
subjectList = dao.getAllSubjectsAlphabetical();
timetableList …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Flutter和Firestore构建应用程序。使用StreamBuilder从Firestore加载Collection以便在ListView中显示它时,出现以下错误
The following assertion was thrown building StreamBuilder<QuerySnapshot>(dirty, state:
I/flutter (26287): _StreamBuilderBaseState<QuerySnapshot, AsyncSnapshot<QuerySnapshot>>#d5638):
I/flutter (26287): type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'Map<String, dynamic>'
I/flutter (26287): where
I/flutter (26287): _InternalLinkedHashMap is from dart:collection
I/flutter (26287): Map is from dart:core
I/flutter (26287): String is from dart:core
Run Code Online (Sandbox Code Playgroud)
这就是我要从 DocumentSnapshot
The following assertion was thrown building StreamBuilder<QuerySnapshot>(dirty, state:
I/flutter (26287): _StreamBuilderBaseState<QuerySnapshot, AsyncSnapshot<QuerySnapshot>>#d5638):
I/flutter (26287): type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'Map<String, dynamic>'
I/flutter (26287): where
I/flutter (26287): _InternalLinkedHashMap …Run Code Online (Sandbox Code Playgroud) 我使用 CLI 启动了一个新的 Firebase 项目。我只使用 Cloud 功能并想部署一些功能,但我收到此错误
functions@ lint: `tslint --project tsconfig.json`
Run Code Online (Sandbox Code Playgroud)
我已经更改了以下几行:
"npm --prefix \"$RESOURCE_DIR\" run lint",
"npm --prefix \"$RESOURCE_DIR\" run build"
Run Code Online (Sandbox Code Playgroud)
到
"npm --prefix \"%RESOURCE_DIR%\" run lint",
"npm --prefix \"%RESOURCE_DIR%\" run build"
Run Code Online (Sandbox Code Playgroud)
因为他们也抛出了错误。
我需要改变什么?
编辑:
我使用 cli 创建了一个新的 Firebase 项目(在名为 Firebase 的文件夹中),并且仅使用 Cloud 函数。然后我将所有 .ts 文件复制到 src 文件夹中并添加了我的依赖项。
"firebase-admin": "~5.12.1",
"firebase-functions": "^1.0.3",
"@types/async": "^2.0.48",
"@types/camelcase": "^4.1.0",
"@types/glob": "^5.0.35",
"@types/request": "^2.47.0",
"@types/xml2js": "^0.4.2",
"async": "^2.6.0",
"camelcase": "^4.1.0",
"glob": "^7.1.2",
"install": "0.10.4",
"npm": "5.6.0",
"request": "^2.85.0",
"xml2js": "^0.4.19"
Run Code Online (Sandbox Code Playgroud)
然后我运行 firebase …
android ×2
firebase ×2
android-collapsingtoolbarlayout ×1
dart ×1
firebase-cli ×1
flutter ×1
lag ×1