Feature Request: Send text instead of files

This commit is contained in:
Robin Linus 2016-01-02 14:23:51 +01:00
parent ce61dc7c60
commit 0e008a5f31
9 changed files with 288 additions and 111 deletions

View file

@ -1,14 +1,16 @@
<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
<link rel="import" href="../file-sharing/file-input-behavior.html">
<link rel="import" href="../text-sharing/text-input-behavior.html">
<dom-module id="buddy-avatar">
<template>
<style>
:host {
display: block;
@apply(--layout-vertical);
@apply(--layout-center);
@apply(--layout-center-center);
width: 120px;
height: 152px;
height: 124px;
cursor: pointer;
}
paper-icon-button {
@ -29,6 +31,8 @@
.paper-font-subhead {
text-align: center;
line-height: 22px;
margin-top: 2px;
}
.paper-font-body1 {
@ -36,7 +40,7 @@
width: 100%;
font-size: 13px;
color: grey;
margin-top: 2px;
line-height: 13px;
}
:host,
@ -46,25 +50,34 @@
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
margin-top: 4px;
}
:host([only1]) {
@apply(--layout-fit);
@apply(--layout-horizontal);
@apply(--layout-center-center);
cursor: pointer;
}
.container {
@apply(--layout-vertical);
@apply(--layout-center);
height: 112px;
padding-top: 16px;
display: block;
}
</style>
<paper-icon-button icon="{{_displayIcon}}"></paper-icon-button>
<div class="paper-font-subhead">{{_displayName}}</div>
<div class="paper-font-body1">{{status}}</div>
<div class="container">
<paper-icon-button icon="{{_displayIcon}}"></paper-icon-button>
<div class="paper-font-subhead">{{_displayName}}</div>
<div class="paper-font-body1">{{status}}</div>
</div>
</template>
<script>
'use strict';
Polymer({
is: 'buddy-avatar',
behaviors: [Chat.FileInputBehavior],
behaviors: [Chat.FileInputBehavior, Chat.TextInputBehavior],
properties: {
contact: Object,
_displayName: {

View file

@ -28,10 +28,6 @@
@apply(--layout-wrap);
}
.buddy {
cursor: pointer;
}
.explanation {
@apply(--paper-font-headline);
color: #4285f4;
@ -60,10 +56,37 @@
}
}
@media all and (max-height: 440px) {
.buddies {
padding-top: 48px;
@apply(--layout-self-start);
}
}
.explanation2 {
display: none;
}
@media all and (min-height: 640px) {
.explanation2 {
display: block;
position: absolute;
top: 128px;
width: 296px;
margin-left: -148px;
left: 50%;
@apply(--paper-font-title);
color: #7baaf7;
text-align: center;
}
}
</style>
<div class="explanation2" hidden$="{{!buddies.0}}">
Tap to send File.<br>Long Press to send Text.
</div>
<div class="buddies">
<template is="dom-repeat" items="{{buddies}}">
<buddy-avatar on-file-selected="_fileSelected" only$="{{!buddies.1}}" contact="{{item}}" class="buddy"></buddy-avatar>
<buddy-avatar on-file-selected="_fileSelected" only$="{{!buddies.1}}" contact="{{item}}"></buddy-avatar>
</template>
</div>
<div hidden$="{{buddies.0}}" class="explanation">