我遇到了你所说的问题,无法编译。
A problem occurred configuring root project 'PingTv - Copy'.
> Could not resolve all files for configuration ':classpath'.
> Could not find semver4j-0.16.4-nodeps.jar (com.github.gundy:semver4j:0.16.4).
Searched in the following locations:
https://jitpack.io/com/github/gundy/semver4j/0.16.4/semver4j-0.16.4-nodeps.jar
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
Run Code Online (Sandbox Code Playgroud)
作为解决方案,我尝试了这个问题中的解决方案,但它对我不起作用。如果您有帮助,我会很高兴。
我的 Gradle 项目文件如下所示:
// Top-level build file where you can add configuration options common
to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
maven {
url "https://jitpack.io"
}
maven {
url "http://oss.sonatype.org/content/repositories/snapshots" …Run Code Online (Sandbox Code Playgroud) 我正在尝试弄清楚流/状态流和数据绑定。
\n在我的项目中,我有 Room 中的“打印机”列表,以及 SharedPreferences 中的“默认打印机”的 ID。
\n\n我是否使用了良好的流程并做得很好,还是出了什么问题?
\n房间给我一个Flow<List<Printer>>。借助我的适配器,我将其显示在回收器视图中viewModel.allPrinters.collect。
但是,当我想从房间绑定资源时,绑定“需要”LiveData 或 StateFlow,这是我的困难,因为 stateIn 需要协程。
\n我怎样才能从我的默认打印机Flow<List<Printer>>(通过他的属性“id”在列表中找到它)并确保列表/项目是否更新,我的参考也将获得更新?\n如果我更改打印机的名称defaultPrinter并将其更新到 room(感谢我的存储库/room DAO),我希望在我的对象defaultPrinter和列表中更改名称。
您还可以确认我的变量类型defaultPrinter应该是StateFlow<Printer?>
注意:当我更新项目时,printerRoomDAO.update(item:Printer)我必须传递数据对象的副本Printer(新引用),否则我的 UI 将不会更新。
isPrinterListEmpty这是我的 ViewModel 中的示例
val hasNoPrinter = allPrinters.mapLatest {\n it.isEmpty()\n}.asLiveData()\nRun Code Online (Sandbox Code Playgroud)\n它运行良好,但我不应该使用 StateFlow 吗?怎么做 ?因为stateIn()需要一个协程,而我下面的尝试不起作用。
val hasNoPrinter = …Run Code Online (Sandbox Code Playgroud) data-binding kotlin android-livedata kotlin-flow kotlin-stateflow
我发现这个代码片段: https: //codepen.io/hani_ouni/pen/LZxKxG它工作得很好codepen.io ,但是当我下载它并尝试在我的机器上运行它时,它不起作用并打印出以下错误在浏览器的控制台上。
这是代码
html :
<div class="sub-header ">
<div class="swipe-tabs">
<div class="swipe-tab">One</div>
<div class="swipe-tab">Two</div>
<div class="swipe-tab">Three</div>
<div class="swipe-tab">Four</div>
<div class="swipe-tab">Five</div>
</div>
</div>
<div class="main-container">
<div class="swipe-tabs-container ">
<div class="swipe-tab-content">Tab 1</div>
<div class="swipe-tab-content">Tab 2</div>
<div class="swipe-tab-content">Tab 3</div>
<div class="swipe-tab-content">Tab 4</div>
<div class="swipe-tab-content">Tab 5</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
$swipe-tab-color: #757575;
$swipe-active-tab-color: #000;
.slick-initialized {
.swipe-tab-content {
position: relative;
min-height: 365px;
@media screen and (min-width: 767px) {
min-height: 500px;
}
}
.swipe-tab {
display: flex;
align-items: center;
justify-content: center;
height: …Run Code Online (Sandbox Code Playgroud) https://material.angular.io/guide/getting-started
ng new testapp
cd testapp
npm install --save @angular/material @angular/cdk
npm install --save @angular/animations
ng serve
Run Code Online (Sandbox Code Playgroud)
应用程序模块.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MatFormFieldModule, MatInputModule } from '@angular/material';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
BrowserAnimationsModule,
MatFormFieldModule,
MatInputModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Run Code Online (Sandbox Code Playgroud)
应用程序组件.html
<p>Test Angular Material</p>
<form>
<mat-form-field class="example-full-width">
<input matInput …Run Code Online (Sandbox Code Playgroud) 所以我刚刚在 angular CLI 中打开了一个新项目,我想安装 Material :
npm install --save @angular/material @angular/cdk
但它给了我以下错误:
C:\Users\TijlD\Desktop\projects\untitled46>npm install --save @angular/material @angular/cdk
npm WARN @angular/animations@5.2.8 requires a peer of @angular/core@5.2.8 but none was installed.
npm WARN @angular/cdk@5.2.4 requires a peer of @angular/core@^5.0.0 but none was installed.
npm WARN @angular/cdk@5.2.4 requires a peer of @angular/common@^5.0.0 but none was installed.
npm WARN @angular/material@5.2.4 requires a peer of @angular/core@^5.0.0 but none was installed.
npm WARN @angular/material@5.2.4 requires a peer of @angular/common@^5.0.0 but none was installed.
Run Code Online (Sandbox Code Playgroud)
有谁知道这意味着什么以及如何摆脱它?
编辑:当我检查 Angular …
我正在寻找一个可以构建像https://tina-material-tree.firebaseapp.com/nested-tree这样的嵌套树的库。但是,它无法使用拖放内容构建树。
不确定是否有人知道像这样支持拖放的类似库。
我将 angular 7 与材料一起使用,我想创建一个带有信息图标的输入字段,最终使用 matSuffix 这是一个工具提示。它适用于台式机,但不适用于手机。
我创建了一个堆栈闪电战:https ://angular-ncv2mp.stackblitz.io/ 我也尝试使用按钮,但它也不起作用。
有谁能够帮助我?
我已经使用了很多 Material UI,所以这令人困惑。我查看了文档,检查了代码,但看不到问题。我希望嵌套组件中的 H2 标记使用 Arial。但是,它使用 Times 进行渲染。我不知道为什么。
这是我的 index.tsx:
import React from "react";
import ReactDOM from "react-dom";
import App from "./components/App";
import { Provider } from "react-redux";
import configureStore from "./redux/stores/main";
import * as serviceWorker from "./serviceWorker";
import { createMuiTheme } from "@material-ui/core";
import myTheme from "./styling/mainTheme";
import { ThemeProvider } from "@material-ui/styles";
const theme = createMuiTheme({
typography: {
fontFamily: ["Arial"].join(",")
}
});
ReactDOM.render(
<ThemeProvider theme={theme}>
<Provider store={configureStore()}>
<App />
</Provider>
</ThemeProvider>,
document.getElementById("root")
);
serviceWorker.unregister();
Run Code Online (Sandbox Code Playgroud)
我的应用程序组件:
import React from …Run Code Online (Sandbox Code Playgroud) 当我使用我的应用程序中的文本主题时,Theme.of(context).textTheme.subhead
文本会更新为适当的大小和重量,但颜色也始终为黑色。如何使用定义的文本主题,同时仍然允许颜色自动更改(例如:当放置在深色按钮上时,从黑色变为白色?
我的应用主题使用默认文本主题,(减去几个重量变化)
我环顾四周,我认为我正在正确使用它,但我不确定。
TextTheme _customizeTextTheme(TextTheme base) {
return base.copyWith(
title: base.title.copyWith(
fontWeight: FontWeight.bold,
),
body2: base.body2.copyWith(
fontWeight: FontWeight.bold,
),
);
}
ThemeData _buildLightTheme() {
const Color primaryColor = Colors.white;
const Color secondaryColor = Colors.red;
final ColorScheme colorScheme = const ColorScheme.light().copyWith(
primary: primaryColor,
secondary: secondaryColor,
);
final ColorScheme buttonColorScheme = const ColorScheme.light().copyWith(
primary: secondaryColor,
secondary: primaryColor,
);
final ThemeData base = ThemeData(
// typography: Typography(
// englishLike: Typography.englishLike2018,
// dense: Typography.dense2018,
// tall: Typography.tall2018,
// ), //This is for …Run Code Online (Sandbox Code Playgroud) angular ×5
android ×1
css ×1
data-binding ×1
flutter ×1
gradle ×1
html ×1
java ×1
javascript ×1
jquery ×1
kotlin ×1
kotlin-flow ×1
material-ui ×1
maven ×1
reactjs ×1
themes ×1
tooltip ×1
tree ×1