小编Can*_*lik的帖子

导航抽屉菜单滚动效果

我在DrawerLayout中使用NavigationView为我的应用程序导航菜单这里是xml:

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drawerLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <include
        layout="@layout/app_bar_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        android:foreground="?android:attr/selectableItemBackground"
        android:theme="@style/NavigationDrawerStyle"
        app:headerLayout="@layout/nav_header_main"
        app:itemIconTint="@color/textColor"
        app:itemTextColor="@color/textColor"
        app:menu="@menu/activity_main_drawer" />
    </android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)

问题:我甚至没有足够的项目滚动,但我在尝试滚动时看到这个效果,我想禁用此效果,谢谢.
滚动效果

更新

尝试两者:

android:overScrollMode "never" in NavigationView
Run Code Online (Sandbox Code Playgroud)

navigationView.setVerticalFadingEdgeEnabled(false);
Run Code Online (Sandbox Code Playgroud)

没用.

我正在调用以下方法onCreate():

public void setupDrawerLayout() {
    drawerLayout = (DrawerLayout) findViewById(R.id.drawerLayout);
    ActionBarDrawerToggle drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolBar, R.string.drawer_open, R.string.drawer_close);
    drawerLayout.setDrawerListener(drawerToggle);
    drawerToggle.syncState();

    navigationView = (NavigationView) findViewById(R.id.nav_view);
    navigationView.setNavigationItemSelectedListener(this);
}
Run Code Online (Sandbox Code Playgroud)

android navigation-drawer material-design android-navigationview

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

Jenkins 在分支的特定提交消息上触发构建

我对这个问题进行了一些搜索和谷歌搜索,但大多数帖子都与如何隔离(通过使用 git 插件等)有关。

我想知道有没有一种方法可以配置 jenkins 作业以在我指定的分支上触发特定提交消息(假设它是否包含“build”)的构建。

提前致谢,

continuous-integration jenkins

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

以字符串表示的二进制数据到 PDF 文件

所以我收到了一个服务的响应,它是 pdf 文件的字节数组表示,String如下所示:

response.pdfStream = "JVBERi0xLjQKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFIvRmlsdGVyIC9GbGF0ZURlY29kZT4+CnN0cmVhbQp4nK1aS3MbxxG+45Qql+9zcQlIEat57wxzAgJIcviQTYCqKGIOKwEWN3hJIKgU+Wt88U9I/kKuOflk6OqrTz4RrHyzu7MASCzHUkypCtBOT3dPT39fdy/1ntBIGkLdH//lzaT2+CQmby9q7wnjUmUPxXrJkM6s9u3mIuOZRLZqd68ylS8zunudx8U6q9Bui3W+e12xYl3sXtcPuxerB5dN/OCytQ+fnbGH13kgduJh75h82D2mfPBkhUDso6cqBIwICFj1sACncUCA2YCACDjJZcBJrkJO6pCTcchJG3BS0ICTggWcFDzgpBABJ4UKOalDTsYhJ03ISRtwUrKAk5IHnJQi4KSUASelCjkZAo4MAUeGgKNCwFEh4KgQcFQIOCoEHBUCjgoBR4WAo0PA0SHg6BBwdAg4OgQcHQKODgFHh4CjQ8CJQ8CJQ8CJQ8CJQ8CJQ8CJQ8CJQ8CJQ8AxIeCYEHBMCDgmBBwTAo4JAceEgGNCwLEh4NgQcGwIODYEHBsCjg0Bx4aAY0PAsSHgMBpCDqMh6DAawg6jIfAwGkIPo8GGj..."
Run Code Online (Sandbox Code Playgroud)

我需要将其转换为绝对字节数组,然后用它创建 pdf 文件以打开。

试过这个:

byte[] pdfStream = response.pdfStream.getBytes(Charsets.UTF_8);
InputStream inputStream = new ByteArrayInputStream(pdfStream);

File file = null;
    try {
        file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), filename);
        Logger.debug("createFile: "+file.getAbsolutePath());
        OutputStream outputStream = new FileOutputStream(file);
        IOUtils.copy(inputStream, outputStream);
        outputStream.close();
    } catch (Exception e) {
        e.printStackTrace();
    }
return file;

try {
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setDataAndType(Uri.fromFile(file), "application/pdf");
    getMainActivity().startActivity(intent);
    } catch (Exception e) {
    Logger.printStackTrace(e);
}
Run Code Online (Sandbox Code Playgroud)

java pdf string binary base64

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

颤振较低的飞镖版本

当我运行flutter get packages命令时,由于Dart版本的Flutter安装程序出现以下错误:

[project_name] flutter软件包获取正在project_name中运行“ flutter软件包获取” ...
当前Dart SDK版本为2.1.0-dev.0.0.flutter-be6309690f。

因为项目依赖于intl_translation> = 0.14.0 + 1 <0.17.0,这需要SDK版本> = 1.12.0 <2.0.0,所以版本解析失败。pub get failed(1)退出代码1

我的框架版本:

Flutter 0.6.0•通道beta• https://github.com/flutter/flutter.git
框架•版本9299c02cf7(2周前)•2018-08-16 00:35:12 +0200
Engine•版本e3687f70c7
工具•Dart 2.1.0-dev.0.0.flutter-be6309690f

我想了解一下是否有某种命令可以降低dart-sdk版本的flutter框架,在此先感谢。

dart dart-sdk flutter flutter-dependencies

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

Android TimeZone土耳其GMT

2016年土耳其政府决定保留GMT + 3时区以保存日光,但在Android上:

Calendar calendar = Calendar.getInstance();
TimeZone tz = TimeZone.getTimeZone("UTC");
calendar.setTimeInMillis(timestamp * 1000);
Date currentTimeZone = (Date) calendar.getTime();
calendar.add(Calendar.MILLISECOND, tz.getOffset(calendar.getTimeInMillis()));
Run Code Online (Sandbox Code Playgroud)

所以问题是;
它显示11月之前的GMT + 3:
10月26星期三18:00:00 GMT + 03:00 2016年
但是11月之后:
Mon Nov 07 20:00:00 GMT + 02:00 2016

它应该全年保持GMT + 3,对于TimeZone的android lib是一个特殊问题还是我做错了什么?
谢谢,

更新
虽然我已经添加了时区和gmt参数的检查,
但对于使用土耳其时区的Android设备来说情况会有点混乱,因为在10月29日之后设备的小时将比正常时间早一个小时,直到Android发布一个更新,用户应用它.

timezone android timestamp

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

ExpandableListView 动态子高度

我有一个ExpandableListViewLinearLayoutas 容器内并使用CustomAdapter.
对于它的孩子,我使用onGroupClick()方法向特定服务发送请求并将结果作为字符串,然后填充单击的组项目的子列表。

问题是因为我无法获得更新的高度(在服务响应设置为子视图文本视图的文本视图之后),linearlayout 容器高度不会增加它应该的方式。而且它还会产生滚动问题。

虽然列表子项xmlWRAP_CONTENT如下:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/rowHeight"
android:background="@color/colorLightYellow">

<TextView
    android:id="@+id/tvTitle"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_centerVertical="true"
    android:layout_marginLeft="@dimen/marginGeneral"
    android:layout_toLeftOf="@+id/tvCount"
    android:gravity="center_vertical"
    android:paddingBottom="@dimen/marginGeneral"
    android:paddingTop="@dimen/marginGeneral"
    android:text="tvTitle"
    android:textColor="@color/colorGray"
    android:textSize="@dimen/fontSizeNormal" />
...
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

所以代码部分对我来说有点长:

@Override
public boolean onGroupClick(ExpandableListView parent, View v, final int groupPosition, long id) {
    Map<Item, List<ItemDetail>> childList = detailExpandableAdapter.getChildList();
    final Item item = detailExpandableAdapter.getGroup(groupPosition);
    if (childList.get(item).size() == 0) {
        startProgressDialog();

        GlobalApplication.getService().getItemDetails(Session.getCurrent().getSessionId(), getItem.item.itemNo, item.name, new ServiceCallback<GetItemDetails>() {
            @Override …
Run Code Online (Sandbox Code Playgroud)

height android expandablelistview expandablelistadapter

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