小编tsi*_*iro的帖子

滑行圆角转换问题

我使用以下代码使用滑动将带圆角的图像加载到imageview中:

Glide.with(this)
                .load(url)
                .listener(new RequestListener<Drawable>() {
                    @Override
                    public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
                        return false;
                    }
                    @Override
                    public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
                        return false;
                    }
                })
                .transition(withCrossFade())
                .apply(new RequestOptions().transform(new RoundedCorners(50)).error(R.drawable.default_person).skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.NONE))
                .into(mBinding.profileImgv);
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述 由于某种原因,图像被像素化.有人能告诉我问题出在哪里吗?

android

25
推荐指数
7
解决办法
3万
查看次数

没有发现碎片匕首2.11的注射器

我有一个片段的活动.我正在尝试注入片段,但我得到'没有找到com.tsiro.dogvip.login.signin.SignInFrgmt'的例子.

ActivityModule:

@Module(includes = BaseActivityModule.class)
public abstract class LoginActivityModule {

   @PerFragment
   @ContributesAndroidInjector(modules = SignInFragmentModule.class)
   abstract SignInFrgmt signInFrgmtInjector();

   @Binds
   @PerActivity
   abstract Activity activity(LoginActivity loginActivity);
}
Run Code Online (Sandbox Code Playgroud)

FragmentModule:

@Module(includes = BaseFragmentModule.class)
public abstract class SignInFragmentModule {

@Binds
@Named(BaseFragmentModule.FRAGMENT)
@PerFragment
abstract Fragment fragment(SignInFrgmt signInFrgmt);

}
Run Code Online (Sandbox Code Playgroud)

Fragment类扩展了BaseFragment,其中实现了HasSupportFragmentInjector.

BaseFragment:

public abstract class BaseFragment extends Fragment implements HasSupportFragmentInjector, Lifecycle.View {

@Inject
DispatchingAndroidInjector<Fragment> fragmentInjector;
public abstract Lifecycle.ViewModel getViewModel();

@SuppressWarnings("deprecation")
@Override
public void onAttach(Activity activity) {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
        // Perform injection here before M, L (API …
Run Code Online (Sandbox Code Playgroud)

android

16
推荐指数
2
解决办法
8352
查看次数

RxJs - 茉莉花弹珠 forkJoin 操作符测试

这是 forkJoin 运算符 jasmine 大理石测试:

it('test1', () => {

 const a = cold('---a|', { a: 1 });
 const b = cold('---b|', { b: 2 });

 const observable = forkJoin(
   a,
   b
 );

 const expected = cold('---21');
 expect(observable).toBeObservable(expected);
});
Run Code Online (Sandbox Code Playgroud)

测试产生以下错误:

Expected $[0].frame = 40 to equal 30.
Expected $[0].notification.value = [ 1, 2 ] to equal '2'.
Expected $[1].frame = 40 to equal 50.
Expected $[1].notification.kind = 'C' to equal 'N'.
Expected $[1].notification.value = undefined to equal '1'.
Expected $[1].notification.hasValue = …
Run Code Online (Sandbox Code Playgroud)

jasmine rxjs angular jasmine-marbles

6
推荐指数
1
解决办法
707
查看次数

出口未定义webpack 4

我正在使用webpack 4捆绑应用程序资源。

tsconfig.json:

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [ "es2015", "dom" ],
    "noImplicitAny": true,
    "suppressImplicitAnyIndexErrors": true,
    "types":  ["node"], 
    "typeRoots": [
      "../node_modules/@types"
    ]
  },
    "compileOnSave": true,
    "exclude": [
       "node_modules"    
    ]
}
Run Code Online (Sandbox Code Playgroud)

webpack.config.js:

module.exports = require("./config/webpack.dev.js");
Run Code Online (Sandbox Code Playgroud)

webpack.common.js:

//common webpack configuration
var webpack = require("webpack");
var path = require("path");
var HtmlWebpackPlugin = require("html-webpack-plugin");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');
var helpers = require("./helpers.js");

module.exports = {
//the entry-point files that …
Run Code Online (Sandbox Code Playgroud)

webpack

5
推荐指数
3
解决办法
5845
查看次数

类型'IPromise <{}>'不能分配给'IPromise <TemplatesPagingModel>'typescript 2.8.0类型

我正在使用angularjs(1.5.8)框架与最新的打字稿(2.8.0)文件.更新到最新的打字稿版本后,不会编译以下代码.

角度接口实现:

interface IPromise<T> {
    /**
     * Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected.
     * The successCallBack may return IPromise<void> for when …
Run Code Online (Sandbox Code Playgroud)

typescript

3
推荐指数
1
解决办法
2153
查看次数

在被点击时将div项目移动到div容器的顶部

!http://postimg.org/image/ym5xp7ilv/

我想要实现的是移动div项目,当点击每个项目时,它被点击在div容器的顶部...其余的项目(那些没有被点击的)将填充div的其余部分容器分别

HTML

    <div class="row">
        <div class="col-md-12">
            <div class="containing_div">
                <div class="container_div"></div>
                <div class="menu_div">
                    <div class="item_div">Photos</div>
                    <div class="item_div">Video</div>
                    <div class="item_div">Music</div>
                    <div class="item_div">Files</div>
                    <div class="item_div">Contacts</div>
                </div>
            </div>
        </div>
    </div>
Run Code Online (Sandbox Code Playgroud)

CSS

.containing_div
{
  height: 100%;
}

.container_div
{
  background: #fff;
  height: 100%;
  width: 90%;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  text-align: center;
  font-family: "Open Sans";
  font-size: 26px;
  float: left;
  padding-top: 25px;
  position: relative;
}

.menu_div
{
  background: transparent;
  float: left;
}

.item_div
{
  background: #ddd;
  height: 80px;
  color: #bbb;
  font-family: …
Run Code Online (Sandbox Code Playgroud)

javascript css

2
推荐指数
1
解决办法
157
查看次数

perl中2种结构类型之间的差异

任何人都可以向我解释Perl中以下结构之间的区别是什么:

$VAR = {"user" => "text", "id" => "textid"};

$VAR = {"user" : 4, "code" : "codetext"};
Run Code Online (Sandbox Code Playgroud)

我如何访问每个结构的值?

perl

1
推荐指数
1
解决办法
46
查看次数

无法选择反应形式角度的多个值

我在我的应用程序中使用 Angular 反应形式。我想为多选表单控件设置多个值。

mycomponent.html

<select id="placeType" 
        class="form-control" 
        [multiple]="true" 
        style="height:200px" 
        formControlName="kalase">
  <option value="" selected="selected" disabled>Select Place Type</option>
  <option *ngFor="let kalase of types" [value]="kalase" [innerHtml]="kalase"></option>      
</select>
Run Code Online (Sandbox Code Playgroud)

mycomponent.ts

types: string[] = ["BAR", "CAFE", "RESTAU", "hotels", "club"];

this.placeForm = this.formBuilder.group({
  kalase: [[this.types[1], this.types[3]]]
});
Run Code Online (Sandbox Code Playgroud)

问题是选择控件中唯一选定的值是类型数组的第四项(“hotels”)。谁能告诉我我做错了什么?

angular

1
推荐指数
1
解决办法
3914
查看次数

不能使用字符串("[{"device_name":"iPhone Simulato"...)作为ARRAY参考,而"严格参考"在使用中

我有以下结构,它在变量my @json_device = getDeviceId($ Session - > {id})中返回;

正在显示的结构如下

$VAR1 = [{"device_name":"device1","device_id":"device_id1"},{"device_name":"device2","device_id":"device_id2"}]
Run Code Online (Sandbox Code Playgroud)

我使用以下代码迭代数组引用并获取"device_name"和"device_id"值

 for my $aref (@json_device){
        for my $href (@$aref){
            warn $href->{device_name};
            warn $href->{device_uuid};
        }
    }
Run Code Online (Sandbox Code Playgroud)

但我得到以下的错误不能使用字符串("[{"device_name":"iPhone Simulato"...)作为ARRAY参考,而使用"严格参考"任何人都可以向我解释出现了什么问题?

perl json

0
推荐指数
1
解决办法
75
查看次数